carlbordum / datatyping Goto Github PK
View Code? Open in Web Editor NEWPythonic type checking
Home Page: http://datatyping.readthedocs.io
License: MIT License
Pythonic type checking
Home Page: http://datatyping.readthedocs.io
License: MIT License
Before #5 can be merged, we need travis to install hypothesis
.
https://travis-ci.org/carlbordum/datatyping/builds/435807225
Thanks to mlevesquedion, we can now convert more tests to use hypothesis.
See:
https://hypothesis.readthedocs.io/en/latest/
https://github.com/carlbordum/datatyping/pull/11/files
Because strings are sequences: https://github.com/Zaab1t/datatyping/blob/master/tests/test_str.py
I was super stupid, when I implemented datatyping.printer.py
. It should be implemented with subclassing instead of monkey patching (with context managers). This would also make it thread-safe.
Relevant: #2.
As a follow-up on #4. Can we use the hypothesis
framework in testing?
What I'm going for is much more diverse data.
All help appreciated!
It would be cool if we included test data from some open apis. Any ideas?
I dont want the tests to fetch the data everytime. It should be hardcoded or read from a file.
When running with Python 3.4
web_1 | Traceback (most recent call last):
web_1 | File "/code/project_name/apps/students/util.py", line 227, in EDEXML_reader
web_1 | pprint(groups_output)
web_1 | File "/usr/local/lib/python3.4/site-packages/datatyping/printer.py", line 111, in pprint
web_1 | with change_pprint_repr():
web_1 | File "/usr/local/lib/python3.4/contextlib.py", line 59, in __enter__
web_1 | return next(self.gen)
web_1 | File "/usr/local/lib/python3.4/site-packages/datatyping/printer.py", line 101, in change_pprint_repr
web_1 | old_format_dict_items = _pprint.PrettyPrinter._format_dict_items
web_1 | AttributeError: type object 'PrettyPrinter' has no attribute '_format_dict_items'
Looking at https://github.com/python/cpython/blob/3.4/Lib/pprint.py you can see that this was introduced in 3.5: https://github.com/python/cpython/blob/3.5/Lib/pprint.py.
Might be worth mentioning that only Python 3.5 and higher are supported!
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.