[pypy-commit] pypy default: Workaround for a bug in pytest<3.0.5: https://github.com/pytest-dev/pytest/issues/2016

rlamy pypy.commits at gmail.com
Fri Nov 16 11:33:11 EST 2018


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: 
Changeset: r95322:51db06536f54
Date: 2018-11-16 16:32 +0000
http://bitbucket.org/pypy/pypy/changeset/51db06536f54/

Log:	Workaround for a bug in pytest<3.0.5: https://github.com/pytest-
	dev/pytest/issues/2016

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
@@ -1,4 +1,7 @@
 import py, sys
+from os.path import abspath, commonprefix, dirname
+
+THIS_DIR = dirname(__file__)
 
 @py.test.mark.tryfirst
 def pytest_runtest_setup(item):
@@ -29,10 +32,11 @@
                 py.test.skip(infomsg)
 
 def pytest_ignore_collect(path, config):
+    path = str(path)
     if py.path.local.sysfind('genreflex') is None and config.option.runappdirect:
-        return True          # "can't run dummy tests in -A"
+        return commonprefix([path, THIS_DIR]) == THIS_DIR
     if disabled:
-        return True
+        return commonprefix([path, THIS_DIR]) == THIS_DIR
 
 disabled = None
 


More information about the pypy-commit mailing list