Commit 1da889da authored by Shane Hathaway's avatar Shane Hathaway

Tests MUST NOT modify sys.path, and if they do, they shall be chastised for

their disobedience.
parent d09439c7
......@@ -52,10 +52,12 @@ class TestRunner:
path, filename=os.path.split(filepath)
name, ext=os.path.splitext(filename)
file, pathname, desc=imp.find_module(name, [path])
saved_syspath = sys.path[:]
try:
module=imp.load_module(name, file, pathname, desc)
finally:
file.close()
sys.path[:] = saved_syspath
function=getattr(module, 'test_suite', None)
if function is None:
return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment