NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2417 most downloaded on PyPI
Hamcrest framework for matcher objects
Last release 3 years ago
no release in 18 months
Release timing varies
gaps range from 6 weeks to 3.9 years
Most releases are documented
notes for 19 of 24 stable releases
Nothing withdrawn
no release was ever pulled
16 years old
24 releases · first in 2010
Nothing published for this version
Nothing published for this version
A whole pile of little updates and testing fixes
A whole pile of little updates and testing fixes
Adds the tests to the sdist. Fixed by #150
Test coverage is now submitted to codecov.io.
Fixed by #150
Change to the has_entry() matcher - if exactly one key matches, but the value does not, report only the mismatching value.
Fixed by #157
Fix is_() type annotations
Misc ^^^^
One column per quarter.
Various type hint bug fixes.
Various type hint bug fixes.
Update change log for 2.0.1, bump version number, and update copyrigh…
Update change log for 2.0.1, bump version number, and update copyrigh…
…t year.
Make hamcrest package PEP 561 compatible, i.e. supply type hints for external use.
Drop formal support for 2.x Drop formal support for 3.x < 3.5
Drop formal support for 2.x Drop formal support for 3.x < 3.5
Fix #128 - raises() grows support for additional matchers on exception object.
Made has_properties() report all mismatches, not just the first.
Silence warnings.
Type fixes.
Remove obsolete dependencies.
Fix #66 - deprecate contains() in favour of contains_exactly(). Fix #72 - make has_properties mismatch description less verbose by adding option to Al…
Add support up to Python 3.8
Fix #66 - deprecate contains() in favour of contains_exactly(). Fix #72 - make has_properties mismatch description less verbose by adding option to AllOf not to include matcher description in its mismatch messages. Fix #82 - include exception details in mismatch description.
Drop formal support for 2.x < 2.7
Drop formal support for 2.x < 2.7 Drop formal support for 3.x < 3.4
Fix #62 - Return result of a deferred call
Fix #56 - incorrect handling of () in is_ matcher Fix #60 - correct calling API call with args
Fix #56 - incorrect handling of () in is_ matcher Fix #60 - correct calling API call with args
Fix #54 - Make instance_of work with tuple like isinstance and unittest's assertIsInstance
Fix #54 - Make instance_of work with tuple like isinstance and unittest's assertIsInstance
Fix #52 - bad handling when reporting mismatches for byte arrays in Python 3
Fix #52 - bad handling when reporting mismatches for byte arrays in Python 3
[Bug] Fix unicode syntax via u() introduction (puppsman)
[Bug] Fix unicode syntax via u() introduction (puppsman)
Added not_ alias for is_not [Matteo Bertini]
Added not_ alias for is_not [Matteo Bertini]
Added doc directory to the sdist [Alex Brandt]
Nothing published for this version
Nothing published for this version
Nothing published for this version
As of this version, support for Python 3.1 has been dropped due to no available CI platform.
2 Sep 2013 (Version 1.7.2)
As of this version, support for Python 3.1 has been dropped due to no available CI platform.
Added support for Python 3.3
string_contains_in_order is now used in the test as it would be in an application, and is properly exported. (Romilly Cocking)
Fix mismatch description of containing_inanyorder (David Keijser)
added import of stringmatches to text/__init__.py (Eric Scheidemantle)
added matches_regexp to __all__ list to library/__init__.py (Eric Scheidemantle)
5 Jan 2010 (Version 1.7.1)
included a fix by jaimegildesagredo for issue #28 (has_properties was not importable)
included a fix by keys for contains_inanyorder
29 Dec 2012 (All changes by Chris Rose unless otherwise noted.)
matches_regexp matches a regular expression in a string.
has_properties matches an object with more than one property.
is_empty matches any object with length 0.
Can now do matching against old-style classes.
Sequence matchers handle generators, as well as actual sequences and pseudo-sequences.
README enhancements by ming13
27 Sep 2011 (All changes by Chris Rose unless otherwise noted.)
27 Sep 2011 (All changes by Chris Rose unless otherwise noted.)
Packaging:
Python 3.2 support.
New matchers:
has_property('property_name', value_matcher) matches if object has a property with a given name whose value satisfies a given matcher.
Improvements:
- hasEntries supports two new calling conventions:
has_entries({'key' : value_matcher, 'key_2' : other_value_matcher}) has_entries(key=value_matcher, key_2=other_value_matcher)
Describe Unicode strings by their __repr__. Thanks to: Sebastian Arming
Rewrote documentation. (Jon Reid)
Python 3.1 support. Thanks to: Chris Rose
29 Apr 2011
Python 3.1 support. Thanks to: Chris Rose
Easier installation with bootstrapping. Thanks to: Chris Rose
"match_equality" wraps a matcher to define equality in terms of satisfying the matcher. This allows Hamcrest matchers to be used in libraries that are not Hamcrest-aware, such as Michael Foord's mock library. Thanks to: Chris Rose
"string_contains_in_order" matches string containing given list of substrings, in order. Thanks to: Romilly Cocking
For consistency, changed "any_of" and "all_of" to implicitly wrap non-matcher values in EqualTo. Thanks to: Chris Rose
Changed "sameInstance" mismatch description to omit address when describing None.
"has_entries" matches dictionary containing key-value pairs satisfying a given list of alternating keys and value matchers.
13 Feb 2011
"has_entries" matches dictionary containing key-value pairs satisfying a given list of alternating keys and value matchers.
"assert_that" can be invoked with a single boolean argument; the reason message is now optional. This is a convenience replacement for assertTrue. Thanks to: Jeong-Min Lee
Reverted 1.3 change: Describe None as "<None>" after all, since it is an object.
"is_" no longer says "is ..." in its description, but just lets the inner description pass through.
Consistently use articles to begin descriptions, such as "a sequence containing" instead of "sequence containing".
PyHamcrest is now compatible with Python 3! To install PyHamcrest on Python 3:
04 Feb 2011
Install the "distribute" package, http://pypi.python.org/pypi/distribute
Run "python3 setup.py install" Unit tests are not converted by the install procedure. Run "2to3 -nw ." separately to convert them. You may discover import statements in the __init__.py files (and one in core/base_description.py) that need dot prefixes. Thanks to: Jeong-Min Lee
Improved descriptions and mismatch descriptions of several matchers, including: - Fixed "contains" and "contains_inanyorder" to describe mismatch if item is not a sequence. - Fixed "described_as" to use nested matcher to generate mismatch description. - "same_instance" is more readable, and includes object memory addresses. - If object has a length, "has_length" mismatch describes actual length. - Describe None as "None" instead of "<None>". - Don't wrap angle brackets around a description that already has them. - Improved readability of several matchers.
Fixed "assert_that" to describe the diagnosis of the mismatch, not just the mismatched value. PyHamcrest will now give even more useful information.
04 Jan 2011
Fixed "assert_that" to describe the diagnosis of the mismatch, not just the
mismatched value. PyHamcrest will now give even more useful information.
Expanded BaseDescription.append_description_of to handle all types of values, not just self-describing values.
Description.append_value no longer needed; call append_description_of instead.
BaseDescription.append_value_list no longer needed; call append_list instead.
SelfDescribingValue no longer needed.
1.2.1 fixes to 1.2: - Corrected manifest so install works. Thanks to: Jeong-Min Lee
"contains" matches sequence containing matching items in order.
28 Dec 2010
"contains" matches sequence containing matching items in order.
"contains_inanyorder" matches sequence containing matching items in any order.
Added Sphinx documentation support.
Text matchers now support Unicode strings
04 Dec 2010 * First official release * Text matchers now support Unicode strings
15 Jan 2008 * Initial submission
Your coding agent can read these notes before it upgrades. Set up the MCP server →