Giter Site home page Giter Site logo

chobeat / hypothesis-csv Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 0.0 77 KB

Extension for the hypothesis framework to support the generative testing with CSV input

License: Apache License 2.0

Python 100.00%
csv generative-testing hypothesis property-based-testing python-library python3

hypothesis-csv's People

Contributors

chobeat avatar jeffbr13 avatar srobuttiteraki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hypothesis-csv's Issues

Missing module multimethod

I'm using Python 3.7 along with conda. The hypothesis_csv library seems to be broken.

In [1]: import hypothesis

In [2]: from hypothesis import given

In [3]: from hypothesis_csv.strategies import csv
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-3-e4dc6582858a> in <module>
----> 1 from hypothesis_csv.strategies import csv

~/.conda/envs/hypothesis/lib/python3.7/site-packages/hypothesis_csv/strategies.py in <module>
----> 1 from hypothesis_csv import _csv
      2 from hypothesis_csv import _data_rows
      3
      4 csv = _csv.csv
      5 data_rows = _data_rows.data_rows

~/.conda/envs/hypothesis/lib/python3.7/site-packages/hypothesis_csv/_csv.py in <module>
      4 from hypothesis.strategies import lists
      5
----> 6 from hypothesis_csv._data_rows import *
      7 from hypothesis_csv.type_utils import *
      8

~/.conda/envs/hypothesis/lib/python3.7/site-packages/hypothesis_csv/_data_rows.py in <module>
      4 from hypothesis.errors import InvalidArgument
      5 from hypothesis.strategies import composite, integers, sampled_from, floats, text
----> 6 from multimethod import overload
      7
      8 from hypothesis_csv.type_utils import *

ModuleNotFoundError: No module named 'multimethod'

Failed test case - test_csv_columns_and_header_seq

I installed and ran the test cases. This was done against https://github.com/jeffbr13/hypothesis-csv from @jeffbr13 because of the Iterable problem.

When I installed in a venv and ran the test cases with pytest I got the following failure.

   AssertionError: assert ['text', 'int', 'int'] == ['text', 'int', 'float']
     At index 2 diff: 'int' != 'float'
     Full diff:
     - ['text', 'int', 'float']
     ?                  ^^^^
     + ['text', 'int', 'int']
     ?                  ^^
   Falsifying example: test_csv_columns_and_header_seq(
       data=data(...),
   )
   Draw 1: 'x,y,z\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\nA,0,2.0\r\n'

Python 3.10 AttributeError: module 'collections' has no attribute 'Iterable'

Hi there! Just thought I'd let you know that the deprecated abstract base classes aliases were removed in Python 3.10 (change) and this is causing an AttributeError wherever collections.Iterable etc. are used.

======================================================== ERRORS ========================================================
__________________________________ ERROR collecting tests/test_import_csv_to_graph.py __________________________________
tests/test_import_csv_to_graph.py:8: in <module>
    from hypothesis_csv.strategies import csv as csv_strategy
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/strategies.py:1: in <module>
    from hypothesis_csv import _csv
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/_csv.py:6: in <module>
    from hypothesis_csv._data_rows import *
../../../../Library/Caches/pypoetry/virtualenvs/my-app-HgQtD8X_-py3.10/lib/python3.10/site-packages/hypothesis_csv/_data_rows.py:21: in <module>
    def get_columns(draw, columns: isa(collections.Iterable)):
E   AttributeError: module 'collections' has no attribute 'Iterable'
=============================================== short test summary info ================================================
ERROR tests/test_import_csv_to_graph.py - AttributeError: module 'collections' has no attribute 'Iterable'

The fix is to replace collections.Iterable and similar lookups with collections.abc.โ€ฆ.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.