python-test-framework icon indicating copy to clipboard operation
python-test-framework copied to clipboard

suggestion: reword "x should equal y" to "expected y\ninstead got x" or similar

Open namedots opened this issue 2 years ago • 1 comments

the current wording, while correct, seems to clash a bit with beginner expectations, it can easily be misread as "given input x, expected y"

the (especially beginner) solver is likely not even aware of what the assertion looks like, and therefore doesn't have the context for the message

namedots avatar Sep 04 '23 23:09 namedots

While I agree with you and whenever given a choice, I prefer the "expected/got" kind of messages (for example Scala lets you choose between the two), many different frameworks seem to use "x should equal y". Especially the ones using matchers, where message expresses the matcher used: expected x to be less than/greater than/equal y, expected x to be empty, expected x to be not null, etc.

I agree that "expected x but got y" could be clearer for newbies, and I'd vote to change the message, but maybe there's some special reason behind "x should equal y" in the framework?

hobovsky avatar Sep 05 '23 00:09 hobovsky