diff options
author | max99x <max99x@gmail.com> | 2011-07-23 06:33:14 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-23 06:33:14 +0300 |
commit | a48bfddf2b9f9d6f6b6ee5dec41004afed3a71ba (patch) | |
tree | 8756ac2beb7e7f421a6115fd583385f15e07976c | |
parent | 942bbd8757172f3a802953f7c33bb82336291232 (diff) |
Fixed a silly global variable leakage in a test.
-rw-r--r-- | tests/runner.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/runner.py b/tests/runner.py index 3ccbb7d8..d75d7e35 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -2406,14 +2406,17 @@ if 'benchmark' not in sys.argv: def test_fs_base(self): global INCLUDE_FULL_LIBRARY; INCLUDE_FULL_LIBRARY = 1 - def addJS(filename): - src = open(filename, 'r').read().replace( - '// {{PRE_RUN_ADDITIONS}}', - open(path_from_root('tests', 'filesystem', 'src.js'), 'r').read()) - open(filename, 'w').write(src) - src = 'int main() {return 0;}\n' - expected = open(path_from_root('tests', 'filesystem', 'output.txt'), 'r').read() - self.do_test(src, expected, post_build=addJS) + try: + def addJS(filename): + src = open(filename, 'r').read().replace( + '// {{PRE_RUN_ADDITIONS}}', + open(path_from_root('tests', 'filesystem', 'src.js'), 'r').read()) + open(filename, 'w').write(src) + src = 'int main() {return 0;}\n' + expected = open(path_from_root('tests', 'filesystem', 'output.txt'), 'r').read() + self.do_test(src, expected, post_build=addJS) + finally: + INCLUDE_FULL_LIBRARY = 0 def test_unistd_access(self): def addPreRun(filename): |