PyHamcrest icon indicating copy to clipboard operation
PyHamcrest copied to clipboard

Hamcrest matchers for Python

Results 29 PyHamcrest issues
Sort by recently updated
recently updated
newest added

I would like our releases to be semi-automated; in theory when one tags, say, V2.0.3 (picking a version _completely at random_) it would automatically kick off a github workflow that...

When there is a async function we want to test ``` async def frobnicate(arg0): raise ValueError("Could not do it") ``` naïvely we may write (*spoiler alert* this will not work)...

Hi, simple example ``` data = {'level1': {'level2': 2}} matcher_level2 = has_entries({'level2': 42}) ``` Why `has_entry` does not display (block) deeper cause?: > assert_that(data, has_entry('level1', matcher_level2)) ``` Expected: a dictionary...

https://github.com/hamcrest/PyHamcrest/blob/405b7539577c56991c7055d257aa72c04c9cc2ab/src/hamcrest/core/assert_that.py#L60-L62 It would stand to reason that that should be `if not isinstance(actual, bool)`.

Hello ! Any plans for I18N of hamcrest ? ``` Assertion Failed: Expected: but: was ``` I see that some of the tests rely on parsing the error message in...

**Using this syntax:** assert_that(ixn_service.get_user_preferences(VALID_CMIS_ID).json().get('offlineVoicemailNotification'), **False**, f"User preference didn't match Expected") **Instead of this syntax:** assert_that(some_service.get_user_preferences(VALID_CMIS_ID).json().get('offlineVoicemailNotification'), **is_(False)**, f"User preference didn't match Expected") **gives me this error:** Unable to display children:Error resolving...

This is more of a feature request rather than a bug. With Python 3, we can have nested exceptions (e.g., raise RuntimeError("blah") from e, where e is another exception that...

feature request

E.g. `assert_that([1, 2], contains_inanyorder(anything(), 1))` fails.

help wanted
feature request

Consider how `equal_to` describes itself: ``` >>> d = StringDescription() >>> d.append_description_of(equal_to(3)) >>> str(d) '' ``` What does `` mean? It's hard to tell. Compare this with other built-in matcher...

feature request