[Python-Dev] PEP: Consolidating names and classes in the `unittest`module (updated 2008-07-15)

Ben Finney ben+python at benfinney.id.au
Wed Jul 16 08:25:06 CEST 2008

Nick Coghlan <ncoghlan at gmail.com> writes:

> What did you think of the "check" idea at the end of the email?
> Test assertions:
>   check(x).almost_equal(y)
>   check(x).is_(y)
>   check(x).in_(y)
>   check(x).equals(y)
> Test negative assertions:
>   check(x).not_almost_equal(y)
>   check(x).is_not(y)
>   check(x).not_in(y)
>   check(x).not_equal(y)


'check' is even less explicit about what will happen than 'assert'. At
least the latter has existing programming-language connotations of
"fail immediately if not true", which 'check' lacks.

 \        “I used to work in a fire hydrant factory. You couldn't park |
  `\                          anywhere near the place.” —Steven Wright |
_o__)                                                                  |
Ben Finney

More information about the Python-Dev mailing list