[py-svn] r35847 - in py/dist/py/test/rsession: . testing

guido at codespeak.net guido at codespeak.net
Mon Dec 18 14:34:54 CET 2006


Author: guido
Date: Mon Dec 18 14:34:52 2006
New Revision: 35847

Modified:
   py/dist/py/test/rsession/conftest.py
   py/dist/py/test/rsession/testing/test_boxing.py
Log:
Added cmdline option to skip the test that keeps failing on codespeak.net (some
problem with multiple levels of nested scripts, some of which do strange setuid
tricks) so that we can make all tests run on that host, and install the svn
'send email on broken tests' thingie.


Modified: py/dist/py/test/rsession/conftest.py
==============================================================================
--- py/dist/py/test/rsession/conftest.py	(original)
+++ py/dist/py/test/rsession/conftest.py	Mon Dec 18 14:34:52 2006
@@ -1,8 +1,15 @@
-#import py 
-#Option = py.test.Config.Option 
+import py
+Option = py.test.Config.Option
 
 #defaultwait = 100.0
 
+option = py.test.Config.addoptions("boxing test options",
+    Option('', '--skip-kill-test', action='store_true', dest='skip_kill_test',
+           help='skip a certain test that checks for os.kill results, this '
+                'should be used when kill() is not allowed for the current '
+                'user'),
+)
+
 #option = py.test.Config.addoptions("distributed testing options", 
 #        Option('-D', '--disthosts',
 #               action="store", dest="disthosts", default=None,

Modified: py/dist/py/test/rsession/testing/test_boxing.py
==============================================================================
--- py/dist/py/test/rsession/testing/test_boxing.py	(original)
+++ py/dist/py/test/rsession/testing/test_boxing.py	Mon Dec 18 14:34:52 2006
@@ -9,6 +9,7 @@
 
 from py.__.test.rsession.box import Box, RealBox, ScreenBox
 from py.__.test.rsession.testing import example2
+from py.__.test.rsession.conftest import option
 
 def setup_module(mod):
     from py.__.test.rsession.rsession import remote_options
@@ -76,22 +77,19 @@
     assert b.retval == 2
 
 def test_box_killer():
+    if option.skip_kill_test:
+        py.test.skip('skipping kill test')
     class A:
         pass
     info = A()
     import time
 
     def box_fun():
-        time.sleep(1500) # we don't want to last forever here
-        open('/tmp/boxingtest_thisshouldnotbehere', 'w').write('grmbl')
+        time.sleep(10) # we don't want to last forever here
     
     b = RealBox(box_fun)
     par, pid = b.run(continuation=True)
-    py.std.time.sleep(1)
-    try:
-        os.kill(pid, 15)
-    except OSError:
-        py.test.skip('strange situation in which os.kill fails...')
+    os.kill(pid, 15)
     par(pid)
     assert b.signal == 15
 


More information about the py-svn mailing list