[Python-ideas] Adding a test discovery into Python

Raymond Hettinger python at rcn.com
Wed Mar 11 23:37:46 CET 2009

[Christian Heimes]
>>> I'm +1 for a simple (!) test discovery system. I'm emphasizing on simple
>>> because there are enough frameworks for elaborate unit testing.

Test discovery is not the interesting part of the problem.
I'm strongly for offering tools that make it easier to write
the tests in the first place.   The syntax used by py.test
and nose is vastly superior to the one used by unittest.py,
a module that is more Javathonic than Pythonic.

Even if we never adopt that syntax for our own test suite
(because we like to run tests with and without -O), it would
still be a good service to our users to offer a tool with
a lighter weight syntax for writing tests.


P.S. I'm not a partisan on this one.  I've been a *heavy* user
of unittest.py, doctest.py, py.test, and some personal tools
that I wrote long ago in awk.  Extensive use of each makes
merits of the py.test and nose approaches self-evident.

Axiom:  The more work involved in writing tests, the fewer
tests that will get written.  

Factoid of the Day:  In Py2.7's test_datetime module,
the phrase self.assertEqual occurs 578 times.

More information about the Python-ideas mailing list