Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: py3.6
Changeset: r98574:deaa30ceb571
Date: 2020-01-23 12:30 +0100
http://bitbucket.org/pypy/pypy/changeset/deaa30ceb571/
Log: fix issue with @pytest.mark.pypy_only
before it would actually crash
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -71,6 +71,8 @@
if mode_A:
from pypy.tool.pytest.apptest import PythonInterpreter
config.applevel = PythonInterpreter(config.option.python)
+ else:
+ config.applevel = None
def pytest_addoption(parser):
group = parser.getgroup("pypy options")
@@ -205,8 +207,9 @@
def pytest_runtest_setup(item):
if isinstance(item, py.test.collect.Function):
config = item.config
- if item.get_marker(name='pypy_only') and not config.applevel.is_pypy:
- pytest.skip('PyPy-specific test')
+ if item.get_marker(name='pypy_only'):
+ if config.applevel is not None and not config.applevel.is_pypy:
+ pytest.skip('PyPy-specific test')
appclass = item.getparent(py.test.Class)
if appclass is not None:
from pypy.tool.pytest.objspace import gettestobjspace
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit