No need to add the test script containing directory to sys.path more than once.

llvm-svn: 106929
This commit is contained in:
Johnny Chen 2010-06-26 00:19:32 +00:00
parent b4d39841e4
commit c43d789a38
1 changed files with 2 additions and 1 deletions

View File

@ -112,7 +112,8 @@ def visit(prefix, dir, names):
if '.py' == os.path.splitext(name)[1] and name.startswith(prefix):
# We found a pattern match for our test case. Add it to the suite.
sys.path.append(dir)
if not sys.path.count(dir):
sys.path.append(dir)
base = os.path.splitext(name)[0]
suite.addTests(unittest.defaultTestLoader.loadTestsFromName(base))