Author: Ronan Lamy <[email protected]>
Branch:
Changeset: r97146:597f4be1ae97
Date: 2019-08-11 17:51 +0100
http://bitbucket.org/pypy/pypy/changeset/597f4be1ae97/
Log: Fix test collection on windows and s390x
diff --git a/pypy/module/_cppyy/test/conftest.py
b/pypy/module/_cppyy/test/conftest.py
--- a/pypy/module/_cppyy/test/conftest.py
+++ b/pypy/module/_cppyy/test/conftest.py
@@ -5,7 +5,7 @@
@py.test.mark.tryfirst
def pytest_runtest_setup(item):
- if py.path.local.sysfind('genreflex') is None:
+ if not disabled and py.path.local.sysfind('genreflex') is None:
import pypy.module._cppyy.capi.loadable_capi as lcapi
if 'dummy' in lcapi.backend_library:
# run only tests that are covered by the dummy backend and tests
@@ -33,16 +33,18 @@
def pytest_ignore_collect(path, config):
path = str(path)
- if py.path.local.sysfind('genreflex') is None and
config.option.runappdirect:
- return commonprefix([path, THIS_DIR]) == THIS_DIR
if disabled:
- return commonprefix([path, THIS_DIR]) == THIS_DIR
+ if commonprefix([path, THIS_DIR]) == THIS_DIR: # workaround for bug
in pytest<3.0.5
+ return True
disabled = None
def pytest_configure(config):
+ global disabled
if config.getoption('runappdirect') or config.getoption('direct_apptest'):
- return # "can't run dummy tests in -A"
+ if py.path.local.sysfind('genreflex') is None:
+ disabled = True # can't run dummy tests in -A
+ return
if py.path.local.sysfind('genreflex') is None:
import pypy.module._cppyy.capi.loadable_capi as lcapi
try:
@@ -77,7 +79,6 @@
standalone=False)
except CompilationError as e:
if '-std=c++14' in str(e):
- global disabled
disabled = str(e)
return
raise
diff --git a/pypy/module/_vmprof/conftest.py b/pypy/module/_vmprof/conftest.py
--- a/pypy/module/_vmprof/conftest.py
+++ b/pypy/module/_vmprof/conftest.py
@@ -1,8 +1,13 @@
-import py, platform, sys
+import pytest
+import platform
+import sys
+from os.path import commonprefix, dirname
-def pytest_collect_directory(path, parent):
- if platform.machine() == 's390x':
- py.test.skip("_vmprof tests skipped")
- if sys.platform == 'win32':
- py.test.skip("_vmprof tests skipped")
-pytest_collect_file = pytest_collect_directory
+THIS_DIR = dirname(__file__)
+
[email protected](tryfirst=True)
+def pytest_ignore_collect(path, config):
+ path = str(path)
+ if sys.platform == 'win32' or platform.machine() == 's390x':
+ if commonprefix([path, THIS_DIR]) == THIS_DIR: # workaround for bug
in pytest<3.0.5
+ return True
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit