diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-03-25 12:34:16 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-04-04 06:36:36 -0600 |
commit | 7e5a41de9fab731e27a761c01302a0a93e2d1070 (patch) | |
tree | dbd6265800ad401476bcde904e9bba86f6af2b85 /numpy/conftest.py | |
parent | 359e53ef8e479eefac0e184d4d25af50c2779ce0 (diff) | |
download | numpy-7e5a41de9fab731e27a761c01302a0a93e2d1070.tar.gz |
TST: Switch to using pytest markers
Use standard pytest markers everywhere in the numpy tests. At this point
there should be no nose dependency. However, nose is required to test
the legacy decorators if so desired.
At this point, numpy test cannot be run in the way with runtests, rather
installed numpy can be tested with `pytest --pyargs numpy` as long as
that is not run from the repo. Run it from the tools directory or some
such.
Diffstat (limited to 'numpy/conftest.py')
-rw-r--r-- | numpy/conftest.py | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/numpy/conftest.py b/numpy/conftest.py index ce985d079..7b1771748 100644 --- a/numpy/conftest.py +++ b/numpy/conftest.py @@ -15,6 +15,7 @@ _old_fpu_mode = None _collect_results = {} +#FIXME when yield tests are gone. @pytest.hookimpl() def pytest_itemcollected(item): """ @@ -52,35 +53,10 @@ def check_fpu_mode(request): if collect_result is not None: old_mode, new_mode = collect_result raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}" - " when collecting the test".format(old_mode, + " when collecting the test".format(old_mode, new_mode)) -def pytest_addoption(parser): - parser.addoption("--runslow", action="store_true", - default=False, help="run slow tests") - - -def pytest_collection_modifyitems(config, items): - if config.getoption("--runslow"): - # --runslow given in cli: do not skip slow tests - return - skip_slow = pytest.mark.skip(reason="need --runslow option to run") - for item in items: - if "slow" in item.keywords: - item.add_marker(skip_slow) - - @pytest.fixture(autouse=True) def add_np(doctest_namespace): doctest_namespace['np'] = numpy - - -for module, replacement in { - 'numpy.testing.decorators': 'numpy.testing.pytest_tools.decorators', - 'numpy.testing.utils': 'numpy.testing.pytest_tools.utils', -}.items(): - module = importlib.import_module(module) - replacement = importlib.import_module(replacement) - module.__dict__.clear() - module.__dict__.update(replacement.__dict__) |