[pypy-commit] pypy pytest-2.9.2: Fix lib-python conftest.py
rlamy
pypy.commits at gmail.com
Tue Nov 15 22:11:06 EST 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: pytest-2.9.2
Changeset: r88402:3d4564d1d24c
Date: 2016-11-16 03:10 +0000
http://bitbucket.org/pypy/pypy/changeset/3d4564d1d24c/
Log: Fix lib-python conftest.py
diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -5,9 +5,10 @@
"""
import py
+import pytest
import sys
+import re
import pypy
-import re
from pypy.interpreter.gateway import ApplevelClass
from pypy.interpreter.error import OperationError
from pypy.interpreter.module import Module as PyPyModule
@@ -517,16 +518,16 @@
for x in testmap:
cache[x.basename] = x
-def pytest_collect_file(path, parent, __multicall__):
- # don't collect files except through this hook
- # implemented by clearing the list of to-be-called
- # remaining hook methods
- __multicall__.methods[:] = []
- regrtest = parent.config._basename2spec.get(path.basename, None)
- if regrtest is None:
- return
- if path.dirpath() != testdir:
- return
+def pytest_ignore_collect(path, config):
+ if path.isfile():
+ regrtest = config._basename2spec.get(path.basename, None)
+ if regrtest is None or path.dirpath() != testdir:
+ return True
+
+ at pytest.hookimpl(tryfirst=True)
+def pytest_pycollect_makemodule(path, parent):
+ config = parent.config
+ regrtest = config._basename2spec[path.basename]
return RunFileExternal(path.basename, parent=parent, regrtest=regrtest)
class RunFileExternal(py.test.collect.File):
More information about the pypy-commit
mailing list