A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-March/071832.html below:

[Python-Dev] unittest enhancement for TestCase classes hierarchies

[Python-Dev] unittest enhancement for TestCase classes hierarchies [Python-Dev] unittest enhancement for TestCase classes hierarchiesCollin Winter collinw at gmail.com
Sat Mar 10 16:13:28 CET 2007
In my continuing trawl through the SF patch tracker, I came across
#1244929 (http://python.org/sf/1244929), which causes
TestLoader.loadTestsFromModule() to skip classes whose name starts
with an underscore. This addresses the warning in that method's docs:

"""
While using a hierarchy of
TestCase-derived classes can be convenient in sharing
fixtures and helper functions, defining test methods on base classes
that are not intended to be instantiated directly does not play well
with this method.  Doing so, however, can be useful when the
fixtures are different and defined in subclasses.
"""

"Does not play well", in this case, means that your base classes will
be picked up against your will if they subclass TestCase.

I like the patch and have worked up tests and doc changes for it. Any
objections to including this in 2.6?

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