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/lib/tests/test_function_base.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/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index c28257c6d..2ea2dbc56 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -4,6 +4,7 @@ import operator import warnings import sys import decimal +import pytest import numpy as np from numpy import ma @@ -11,7 +12,7 @@ from numpy.testing import ( run_module_suite, assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_array_max_ulp, assert_warns, assert_raises_regex, - dec, suppress_warnings, + suppress_warnings, HAS_REFCOUNT, ) import numpy.lib.function_base as nfb from numpy.random import rand @@ -2143,7 +2144,7 @@ class TestBincount(object): "must not be negative", lambda: np.bincount(x, minlength=-1)) - @dec._needs_refcount + @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts") def test_dtype_reference_leaks(self): # gh-6805 intp_refcount = sys.getrefcount(np.dtype(np.intp)) @@ -2987,7 +2988,7 @@ class TestAdd_newdoc_ufunc(object): class TestAdd_newdoc(object): - @dec.skipif(sys.flags.optimize == 2) + @pytest.mark.skipif(sys.flags.optimize == 2, reason="Python running -OO") def test_add_doc(self): # test np.add_newdoc tgt = "Current flat index into the array." |