Closed dz0 closed 3 years ago
ps.: py 3.6 allows f-string style -- which is less clumsy
description.append_text(f"calendar date on {self.day_as_string[self.day]}")
I think the example in the readme is intentionally pretty minimal. The docs do extend to mentioning describe_mismatch()
- see Writing Custom Matchers.
The README is, per Simon's comment, intentionally minimal and doesn't try to capture the custom matcher authoring case in detail.
The f-string case is definitely a "we will get around to that at some point" change :)
in
BaseMatcher
there are:describe_mismatch
(often overriden)describe_match
(seldom overriden) https://github.com/hamcrest/PyHamcrest/blob/9063031c1de6aa39c5f0ccc1314220915b31c599/src/hamcres/core/base_matcher.pyin custom matcher example https://github.com/hamcrest/PyHamcrest#writing-custom-matchers there is
describe_to
-- seems bit inconsistent -- as it describes failure, but usually describes matcher itselfI'd expect the example to have sth like this