Commit bf8322ac authored by Denis Bilenko's avatar Denis Bilenko

fixed testrunner.py to run test_patched_module properly

parent c91e1dec
......@@ -199,8 +199,13 @@ def run_tests(options, args):
test_support.BasicTestRunner = _runner
if os.path.exists(arg):
sys.argv = args
# QQQ this makes tests reported as if they are from __main__ and screws up warnings location
execfile(arg, globals())
saved_globals = {'__file__': __file__}
try:
globals()['__file__'] = arg
# QQQ this makes tests reported as if they are from __main__ and screws up warnings location
execfile(arg, globals())
finally:
globals().update(saved_globals)
else:
test = defaultTestLoader.loadTestsFromName(arg)
result = _runner().run(test)
......
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