[pypy-commit] pypy pytest: testrunner: only do the monkeypatching in scratchbox if its required

RonnyPfannschmidt noreply at buildbot.pypy.org
Fri Mar 2 17:10:38 CET 2012


Author: Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
Branch: pytest
Changeset: r53117:cea99ad451e6
Date: 2012-03-02 17:04 +0100
http://bitbucket.org/pypy/pypy/changeset/cea99ad451e6/

Log:	testrunner: only do the monkeypatching in scratchbox if its required

diff --git a/testrunner/scratchbox_runner.py b/testrunner/scratchbox_runner.py
--- a/testrunner/scratchbox_runner.py
+++ b/testrunner/scratchbox_runner.py
@@ -14,14 +14,14 @@
 def dry_run_scratchbox(args, cwd, out, timeout=None):
     return dry_run(args_for_scratchbox(cwd, args), cwd, out, timeout)
 
-import runner
-# XXX hack hack hack
-dry_run = runner.dry_run
-run = runner.run
+if __name__ == '__main__':
+    import runner
+    # XXX hack hack hack
+    dry_run = runner.dry_run
+    run = runner.run
 
-runner.dry_run = dry_run_scratchbox
-runner.run = run_scratchbox
+    runner.dry_run = dry_run_scratchbox
+    runner.run = run_scratchbox
 
-if __name__ == '__main__':
     import sys
     runner.main(sys.argv)


More information about the pypy-commit mailing list