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

Andrew Bennetts andrew-pythondev at puzzling.org
Wed Jul 16 09:00:56 CEST 2008


Nick Coghlan wrote:
[...]
>
> 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)

Wow.

This is a textbook example of a bikeshed discussion.  The names (and now
syntax!) of assertions are the most cosmetic issue there is with the unittest
module, yet I see over *200* messages about it.

Deeper, but important issues, such as how to raise structured exceptions that a
GUI test runner could usefully display and introspect, are ignored.  I can list
lots of others.

For assertions, just flip a coin already (or a roll a d20, perhaps...).  Can we
perhaps devote this considerable energy to significant improvements, please?

-Andrew.



More information about the Python-Dev mailing list