Antoine Pitrou <[EMAIL PROTECTED]> 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.

-- 
 \       “First things first, but not necessarily in that order.” —The |
  `\                                              Doctor, _Doctor Who_ |
_o__)                                                                  |
Ben Finney

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to