[Python-Dev] Tweaking the stdlib test infrastructure (original) (raw)

Walter Dörwald walter at livinglogic.de
Tue Apr 24 09:19:37 CEST 2007


Collin Winter wrote:

Fast and simple: I want all stdlib test cases to stop subclassing unittest.TestCase and start subclassing testsupport.TestCase.

Why: With a single parent class common to the entire stdlib, adding new functionality/testing instruments to every single test at once becomes trivial. One example would be to move "regrtest -R"'s focus from module-level refleaks to test case-level refleaks (that is, looped execution of individual test cases, rather than test modules). I intend to implement this new refleak checking soon, if this base change goes ahead. How: At first, testsupport.TestCase could be as simple as "TestCase = unittest.TestCase". Once we want to extend the test harness's capabilities, we change it to "class TestCase(unittest.TestCase): blah blah blah". All code under Lib/test/ is changed to subclass the proper class. testsupport.rununittest() can be modified to make sure that incoming classes inherit as they're supposed to.

+1

[...]

Servus, Walter



More information about the Python-Dev mailing list