[py-svn] r32594 - py/branch/distributed/py/test/rsession

arigo at codespeak.net arigo at codespeak.net
Fri Sep 22 18:44:26 CEST 2006


Author: arigo
Date: Fri Sep 22 18:44:25 2006
New Revision: 32594

Modified:
   py/branch/distributed/py/test/rsession/box.py
Log:
Here is where to put os.nice() to run the tests more nicely on all the
client machines.



Modified: py/branch/distributed/py/test/rsession/box.py
==============================================================================
--- py/branch/distributed/py/test/rsession/box.py	(original)
+++ py/branch/distributed/py/test/rsession/box.py	Fri Sep 22 18:44:25 2006
@@ -9,6 +9,8 @@
 import marshal
 import thread
 
+NICE_LEVEL = 0     # XXX make it a conftest option
+
 PYTESTSTDOUT = "pyteststdout"
 PYTESTSTDERR = "pyteststderr"
 PYTESTRETVAL = "pytestretval"
@@ -80,6 +82,8 @@
         sys.stdout = os.fdopen(1, "w", 0)
         sys.stderr = os.fdopen(2, "w", 0)
         retvalf = open(self.PYTESTRETVAL, "w")
+        if NICE_LEVEL:
+            os.nice(NICE_LEVEL)
         retval = self.fun(*self.args, **self.kwargs)
         retvalf.write(marshal.dumps(retval))
         retvalf.close()
@@ -177,6 +181,8 @@
             os.dup2(fdstderr, 2)
         retvalf = self.PYTESTRETVAL.open("w")
         try:
+            if NICE_LEVEL:
+                os.nice(NICE_LEVEL)
             retval = self.fun(*self.args, **self.kwargs)
             retvalf.write(marshal.dumps(retval))
         finally:



More information about the pytest-commit mailing list