From 7e5a41de9fab731e27a761c01302a0a93e2d1070 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 25 Mar 2018 12:34:16 -0600 Subject: 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. --- numpy/lib/tests/test_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/lib/tests/test_utils.py') diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py index 92bcdc238..7d8e7e68e 100644 --- a/numpy/lib/tests/test_utils.py +++ b/numpy/lib/tests/test_utils.py @@ -1,9 +1,11 @@ from __future__ import division, absolute_import, print_function import sys +import pytest + from numpy.core import arange from numpy.testing import ( - run_module_suite, assert_, assert_equal, assert_raises_regex, dec + run_module_suite, assert_, assert_equal, assert_raises_regex ) from numpy.lib import deprecate import numpy.lib.utils as utils @@ -14,7 +16,7 @@ else: from StringIO import StringIO -@dec.skipif(sys.flags.optimize == 2) +@pytest.mark.skipif(sys.flags.optimize == 2, reason="Python running -OO") def test_lookfor(): out = StringIO() utils.lookfor('eigenvalue', module='numpy', output=out, -- cgit v1.2.1 From 7bf0564f87511d9e7b6287b3eec0857d0d7742df Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Wed, 4 Apr 2018 10:33:07 -0600 Subject: MAINT: Remove all uses of run_module_suite. That function is nose specific and has not worked since `__init__` files were added to the tests directories. --- numpy/lib/tests/test_utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'numpy/lib/tests/test_utils.py') diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py index 7d8e7e68e..c27c3cbf5 100644 --- a/numpy/lib/tests/test_utils.py +++ b/numpy/lib/tests/test_utils.py @@ -4,9 +4,7 @@ import sys import pytest from numpy.core import arange -from numpy.testing import ( - run_module_suite, assert_, assert_equal, assert_raises_regex - ) +from numpy.testing import assert_, assert_equal, assert_raises_regex from numpy.lib import deprecate import numpy.lib.utils as utils @@ -67,7 +65,3 @@ def test_byte_bounds(): def test_assert_raises_regex_context_manager(): with assert_raises_regex(ValueError, 'no deprecation warning'): raise ValueError('no deprecation warning') - - -if __name__ == "__main__": - run_module_suite() -- cgit v1.2.1