@@ -185,7 +185,7 @@ def gc_collect():
185
185
gc .collect ()
186
186
187
187
188
- def pytest_namespace ():
188
+ def pytest_configure ():
189
189
"""Add import suppression and test requirements to `pytest` namespace"""
190
190
try :
191
191
import numpy as np
@@ -202,19 +202,17 @@ def pytest_namespace():
202
202
pypy = platform .python_implementation () == "PyPy"
203
203
204
204
skipif = pytest .mark .skipif
205
- return {
206
- 'suppress' : suppress ,
207
- 'requires_numpy' : skipif (not np , reason = "numpy is not installed" ),
208
- 'requires_scipy' : skipif (not np , reason = "scipy is not installed" ),
209
- 'requires_eigen_and_numpy' : skipif (not have_eigen or not np ,
210
- reason = "eigen and/or numpy are not installed" ),
211
- 'requires_eigen_and_scipy' : skipif (not have_eigen or not scipy ,
212
- reason = "eigen and/or scipy are not installed" ),
213
- 'unsupported_on_pypy' : skipif (pypy , reason = "unsupported on PyPy" ),
214
- 'unsupported_on_py2' : skipif (sys .version_info .major < 3 ,
215
- reason = "unsupported on Python 2.x" ),
216
- 'gc_collect' : gc_collect
217
- }
205
+ pytest .suppress = suppress
206
+ pytest .requires_numpy = skipif (not np , reason = "numpy is not installed" )
207
+ pytest .requires_scipy = skipif (not np , reason = "scipy is not installed" )
208
+ pytest .requires_eigen_and_numpy = skipif (not have_eigen or not np ,
209
+ reason = "eigen and/or numpy are not installed" )
210
+ pytest .requires_eigen_and_scipy = skipif (
211
+ not have_eigen or not scipy , reason = "eigen and/or scipy are not installed" )
212
+ pytest .unsupported_on_pypy = skipif (pypy , reason = "unsupported on PyPy" )
213
+ pytest .unsupported_on_py2 = skipif (sys .version_info .major < 3 ,
214
+ reason = "unsupported on Python 2.x" )
215
+ pytest .gc_collect = gc_collect
218
216
219
217
220
218
def _test_import_pybind11 ():
0 commit comments