Antoine Pitrou firstname.lastname@example.org writes:
Ben Finney <bignose+hates-spam <at> benfinney.id.au> writes:
That would better be written (preferring PEP 8 names) "fail_unless_equal".
Which is still a double negative ("fail" and "unless" are both negative words).
Hmm, not to this native-English-speaker's ear. "fail" is a verb stating what will be done, while "unless" and "if" are the conditions under which it will be done.
That's another reason to avoid "assert" in the name: these methods *don't* necessarily use the 'assert' statement.
But all those constructs (assert, assertEqual, etc.) raise the same exception type named AssertionError
Only by default. They can be overridden to raise any exception type.
The only thing they have in common at that point (when the exception is raised) is that they have failed the test.