Ensure test matching does not return dupes

This commit is contained in:
Kovid Goyal 2016-06-30 08:12:09 +05:30
parent 74134dd429
commit cedde63fe8

View File

@ -82,9 +82,11 @@ def init_env():
def filter_tests(suite, test_ok): def filter_tests(suite, test_ok):
ans = unittest.TestSuite() ans = unittest.TestSuite()
added = set()
for test in itertests(suite): for test in itertests(suite):
if test_ok(test): if test_ok(test) and test not in added:
ans.addTest(test) ans.addTest(test)
added.add(test)
return ans return ans
def filter_tests_by_name(suite, *names): def filter_tests_by_name(suite, *names):