by calpaterson · 5y ago · 0 comments
Better error messages was the motivation: PyHamcrest tends to put everything onto one line, which makes it hard to discern structure. In contrast, precisely tries to produce an error message that uses line breaks and indentation to match the structure of the matcher, hopefully making it clear exactly which part of the matcher has failed.
assert foo["bar"] == 123
assert foo["baz"]["bam"]["boo"] = "abc"
I don't see how is that made easier (and less ambiguous) in hamcrest-style assertions...There's no particurly terse why to write an example I'm afraid.