A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-April/072710.html below:

[Python-Dev] Tweaking the stdlib test infrastructure

[Python-Dev] Tweaking the stdlib test infrastructure [Python-Dev] Tweaking the stdlib test infrastructureCollin Winter collinw at gmail.com
Tue Apr 24 02:39:42 CEST 2007
Fast and simple: I want all stdlib test cases to stop subclassing
unittest.TestCase and start subclassing test_support.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, test_support.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. test_support.run_unittest() can be modified to make sure that
incoming classes inherit as they're supposed to.

But that sounds like a lot of work: yes, but that's what we have
regexes for. Most of this work can be done with a few global
search-and-replace operations.


So: any objections to making this change?

Collin Winter
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4