Add workaround for old version of TestCase

Old version of TestCase has no __eq__ function
This commit is contained in:
Cédric Krier committed 2010-03-04 19:49:15 +01:00
1 parent c185cc309d
commit 3537d7fc4e
1 file changed
+12 -2
+12 -2
View File
@@ -241,8 +241,18 @@ def modules_suite():
else:
continue
for test in test_mod.suite():
if test not in suite_:
suite_.addTest(test)
if hasattr(test, '__eq__'):
if test not in suite_:
suite_.addTest(test)
else:
found = False
for other in suite_:
if type(test) == type(other) and \
test._testMethodName == other._testMethodName:
found = True
break
if not found:
suite_.addTest(test)
return suite_
if __name__ == '__main__':