Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
fix extra_tests - apparently pytest_addoption can only be in toplevel…
Browse files Browse the repository at this point in the history
  • Loading branch information
mattip committed Nov 7, 2020
1 parent dd2e8e6 commit dc4dff9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions extra_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ def get_marker(item, name):
# pytest < 3.6
return item.get_marker(name=name)


def pytest_runtest_setup(item):
if get_marker(item, name='pypy_only'):
if '__pypy__' not in sys.builtin_module_names:
pytest.skip('PyPy-specific test')


def pytest_configure(config):
config.addinivalue_line("markers", "pypy_only: PyPy-specific test")


def pytest_addoption(parser):
parser.addoption(
"--compiler-v", action="store_true",
help="Print to stdout the commands used to invoke the compiler")

5 changes: 0 additions & 5 deletions extra_tests/hpy_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ def pytest_configure(config):
from _hpy_universal. Look at conftest.py for more details
""")

def pytest_addoption(parser):
parser.addoption(
"--compiler-v", action="store_true",
help="Print to stdout the commands used to invoke the compiler")

@pytest.fixture(scope='session')
def hpy_devel(request):
from pypy.module._hpy_universal._vendored.hpy.devel import HPyDevel
Expand Down

0 comments on commit dc4dff9

Please sign in to comment.