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_recfunctions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/lib/tests/test_recfunctions.py') diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index bc9f8d7b6..e1b62d46a 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -1,11 +1,13 @@ from __future__ import division, absolute_import, print_function +import pytest + import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal from numpy.testing import ( - run_module_suite, assert_, assert_raises, dec + run_module_suite, assert_, assert_raises, ) from numpy.lib.recfunctions import ( drop_fields, rename_fields, get_fieldstructure, recursive_fill_fields, @@ -687,7 +689,7 @@ class TestJoinBy(object): b = np.ones(3, dtype=[('c', 'u1'), ('b', 'f4'), ('a', 'i4')]) assert_raises(ValueError, join_by, ['a', 'b', 'b'], a, b) - @dec.knownfailureif(True) + @pytest.mark.xfail(reason="See comment at gh-9343") def test_same_name_different_dtypes_key(self): a_dtype = np.dtype([('key', 'S5'), ('value', ' 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_recfunctions.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'numpy/lib/tests/test_recfunctions.py') diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index e1b62d46a..219ae24fa 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -6,9 +6,7 @@ import numpy as np import numpy.ma as ma from numpy.ma.mrecords import MaskedRecords from numpy.ma.testutils import assert_equal -from numpy.testing import ( - run_module_suite, assert_, assert_raises, - ) +from numpy.testing import assert_, assert_raises from numpy.lib.recfunctions import ( drop_fields, rename_fields, get_fieldstructure, recursive_fill_fields, find_duplicates, merge_arrays, append_fields, stack_arrays, join_by @@ -831,6 +829,3 @@ class TestAppendFieldsObj(object): control = np.array([(obj, 1.0, 10), (obj, 2.0, 20)], dtype=[('A', object), ('B', float), ('C', int)]) assert_equal(test, control) - -if __name__ == '__main__': - run_module_suite() -- cgit v1.2.1