Skip to main content

Utilities to aid in testing for equality.

Project description

Help with failing asserts like

assert actual == {
'id': 123,
'field1': 1,
...
}

Where 'id' is generated by the database and is different every test run.
Fix this using 'AnyInt':

assert actual == {
'id': AnyInt(),
'field1': 1,
...
}

Instances of AnyInt compare equal to any integer. So this assertion will
now pass if and only if the value of the 'id' field is an int.

There are other classes for use in other situations.

Dependencies
------------

Written on Python 2.7 (sorry),
but it's a bug if it doesn't work on 3 as well.

Install
-------

::

pip install equality

Plans
-----

Slowly add occasional new classes as the need arises.

Known Problems
--------------

It's hot of the presses, so is doubtless full of mistakes.

Alternatives
------------

This doubtless duplicates better work elsewhere. Let me know and I'll
happily delete this project.

Thanks
------

To all the good folks formerly of Resolver Systems.

Contact
-------

:For users: Downloads & documentation:
http://pypi.python.org/pypi/equality/

:For developers: Souce code & issues:
https://github.com/tartley/equality/

:Contact the author:
Jonathan Hartley, email: tartley at domain tartley.com, Twitter: @tartley.



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

equality-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

equality-0.0.1-py2.py3-none-any.whl (5.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file equality-0.0.1.tar.gz.

File metadata

  • Download URL: equality-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for equality-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d36a68518bacde899bd866e16aa9094a30d60fab98a3031f6d3db4ee5742d6ce
MD5 9190a227ea1f98e8bd43c152994ad8d2
BLAKE2b-256 68bfc8c8f4ad2e9ec6faf64b57a6ed18febaae9861715cee68c7bfe458a1bb60

See more details on using hashes here.

File details

Details for the file equality-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for equality-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 413c54387e3217e5740219f5c3106f47d8047d171465d8a337a34dcc63708b1d
MD5 eeb5389383d3c4d53311db621cc12c8f
BLAKE2b-256 0ecad8b2088367f644848ae33103aa0d68bd8d341d3f31f941e3c344a432deae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page