[Python-Dev] r87389 - in python/branches/py3k: Doc/library/unittest.rst Lib/unittest/case.py Misc/NEWS

Simon Brunning simon at brunningonline.net
Thu Dec 23 10:40:12 CET 2010

On 22 December 2010 01:37, Guido van Rossum <guido at python.org> wrote:
> Furthermore, Java's jUnit puts expected first (and makes this part of
> the culture/religion), so people coming from there will use that order
> and be freaked out if you were to swap them. And last, the order of
> diff arguments (old new) is also ingrained in the culture (which
> actually matches the expected/actual order in my mind).

For what it's worth, none of the (numerous) Java projects that I've
worked on over the last couple of years have used bare JUnit.
Assertions are often done using the Hamcrest library -
<http://code.google.com/p/hamcrest/>. The actual value comes first,
and this combined with the use of matchers makes the failure messages
very descriptive.

I'd hate to go back to one of those projects where the tests tell you
that two values don't match, but doesn’t tell me which is the expected
value. There is a Python port -
<http://code.google.com/p/hamcrest/wiki/TutorialPython>. I must get
around to trying that.

Simon B.

More information about the Python-Dev mailing list