[pypy-svn] pypy default: make it possible for the subprocess to skip a test

antocuni commits-noreply at bitbucket.org
Fri Apr 15 13:29:46 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r43386:03c5587320a2
Date: 2011-04-15 12:13 +0200
http://bitbucket.org/pypy/pypy/changeset/03c5587320a2/

Log:	make it possible for the subprocess to skip a test

diff --git a/pypy/module/pypyjit/test_pypy_c/test_model.py b/pypy/module/pypyjit/test_pypy_c/test_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_model.py
@@ -52,6 +52,8 @@
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
         stdout, stderr = pipe.communicate()
+        if stderr.startswith('SKIP:'):
+            py.test.skip(stderr)
         assert not stderr
         #
         # parse the JIT log
@@ -268,6 +270,14 @@
         log = self.run(src, [30, 12])
         assert log.result == 42
 
+    def test_skip(self):
+        import _pytest
+        def f():
+            import sys
+            print >> sys.stderr, 'SKIP: foobar'
+        #
+        raises(_pytest.runner.Skipped, "self.run(f, [])")
+
     def test_parse_jitlog(self):
         def f():
             i = 0


More information about the Pypy-commit mailing list