Collection of Python utilities
Project description
vrypy
Collection of Python utilities.
vrypy.test.deep
Test utilities inspired by Perl Test::Deep
>>> from vrypy.test.deep import ignore, bag, super_dict_of
The ignore()
for ignoring part of the structure during test comparison:
>>> assert {'key': 'value'} == {'key': ignore()}
>>> assert ["value1", "value2", "value3"] == ["value1", ignore(), ignore()]
The bag(List)
for order-insensitive comparison:
>>> assert {'key': [1, 3, 2]} == {'key': bag([1,2,3])}
>>> assert [1,2,3,4] != bag([1,2,3])
The super_dict_of(Dict)
for dict comparison with ignoring superfluous keys:
>>> assert {'key': 'value', 'not interesting key': 'value'} \
... == super_dict_of({'key': 'value'})
>>> assert {'key': 'value'} != super_dict_of({'expected key': 'value'})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vrypy-0.3.tar.gz
(1.9 kB
view hashes)
Built Distribution
vrypy-0.3-py3-none-any.whl
(3.4 kB
view hashes)