chobeat / hypothesis-csv Goto Github PK
View Code? Open in Web Editor NEWExtension for the hypothesis framework to support the generative testing with CSV input
License: Apache License 2.0
Extension for the hypothesis framework to support the generative testing with CSV input
License: Apache License 2.0
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'
The Python Packaging Authority has recently created a new trove classifier to help users find Hypothesis-related packages, as described and demonstrated in HypothesisWorks/hypothesis#1663.
It would be great if this package used it too!
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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nA,0,2.0\r\n'
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.โฆ
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.