Message179663
As suggested in the previous comment, here is simple code to find candidates for test duplication (TestCase subclasses subclassing other TestCase classes):
def find_dupes(mod):
objects = [getattr(mod, name) for name in sorted(dir(mod))]
classes = [obj for obj in objects if isinstance(obj, type) and
issubclass(obj, unittest.TestCase)]
for c in classes:
for d in classes:
if c is not d and issubclass(d, c):
print("%s: %s < %s" % (mod.__name__, c.__name__, d.__name__))
Out of curiosity, I ran a modified form of this against all test modules to find which ones fit this pattern and *already* rely on unittest discovery (i.e. don't have test_main()). We might want to adjust these as well. There were four: test_asyncore, test_configparser, test_heapq, test_ipaddress |
|
Date |
User |
Action |
Args |
2013-01-11 10:26:34 | chris.jerdonek | set | recipients:
+ chris.jerdonek, brett.cannon, terry.reedy, ezio.melotti, eric.araujo, r.david.murray, python-dev, zach.ware, serhiy.storchaka |
2013-01-11 10:26:34 | chris.jerdonek | set | messageid: <1357899994.43.0.202242545804.issue16748@psf.upfronthosting.co.za> |
2013-01-11 10:26:34 | chris.jerdonek | link | issue16748 messages |
2013-01-11 10:26:33 | chris.jerdonek | create | |
|