[pypy-commit] pypy win32-fixes6: ensure disabled vmprof can skip tests

mattip pypy.commits at gmail.com
Thu Sep 14 00:41:53 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-fixes6
Changeset: r92385:049fa1d8e804
Date: 2017-09-14 06:46 +0300
http://bitbucket.org/pypy/pypy/changeset/049fa1d8e804/

Log:	ensure disabled vmprof can skip tests

diff --git a/pypy/module/_vmprof/interp_vmprof.py b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -3,6 +3,7 @@
 from pypy.interpreter.pyframe import PyFrame
 from pypy.interpreter.pycode import PyCode
 from pypy.interpreter.baseobjspace import W_Root
+from rpython.translator.platform import CompilationError
 from rpython.rlib import rvmprof, jit
 from pypy.interpreter.error import oefmt
 
@@ -11,8 +12,10 @@
 
 _get_code = lambda frame, w_inputvalue, operr: frame.pycode
 _decorator = rvmprof.vmprof_execute_code("pypy", _get_code, W_Root)
-my_execute_frame = _decorator(PyFrame.execute_frame)
-
+try:
+    my_execute_frame = _decorator(PyFrame.execute_frame)
+except CompilationError:
+    raise rvmprof.VMProfPlatformUnsupported('compilation failed')
 
 class __extend__(PyFrame):
     def execute_frame(self, w_inputvalue=None, operr=None):
diff --git a/pypy/module/_vmprof/test/test__vmprof.py b/pypy/module/_vmprof/test/test__vmprof.py
--- a/pypy/module/_vmprof/test/test__vmprof.py
+++ b/pypy/module/_vmprof/test/test__vmprof.py
@@ -1,4 +1,7 @@
-import sys
+import sys, py
+if sys.platform == 'win32':
+    py.test.skip('vmprof disabled on windows')
+
 from rpython.tool.udir import udir
 from pypy.tool.pytest.objspace import gettestobjspace
 
diff --git a/pypy/module/_vmprof/test/test_direct.py b/pypy/module/_vmprof/test/test_direct.py
--- a/pypy/module/_vmprof/test/test_direct.py
+++ b/pypy/module/_vmprof/test/test_direct.py
@@ -5,6 +5,9 @@
 except ImportError:
     py.test.skip('cffi required')
 
+if sys.platform == 'win32':
+    py.test.skip('vmprof disabled on windows')
+
 from rpython.rlib import rvmprof
 srcdir = py.path.local(rvmprof.__file__).join("..", "src")
 shareddir = srcdir.join('shared')


More information about the pypy-commit mailing list