[TIP] Some simple examples for testing stuff

C. Titus Brown ctb at msu.edu
Mon Mar 8 22:12:11 PST 2010

Hi all,

I sat down and went through the various e-mails from the long testing/packaging
thread, and implemented some of the mechanisms described therein; I just need
code to get a feeling for things, ya know? ;)

Anyway, I'd be interested in comments, corrections, and thoughts on the


Everything is under 



An example of using 'discover':



Using setuptools' 'test_suite' argument:



Using setuptools' 'test_loader' argument:



Building a fake TestSuite-like object:



I'm particularly intrigued by the idea of coming up with a standard that
specifies some API-level compatibility with the discover protocol as well as
unittest behavior, e.g.

   python -m unittest <something>

but I didn't get a chance to figure this out tonight.  Code welcome,
esp in the context of the last (fake_suite) example.

C. Titus Brown, ctb at msu.edu

More information about the testing-in-python mailing list