diff options
Diffstat (limited to 'numpy/testing/tests')
-rw-r--r-- | numpy/testing/tests/test_doctesting.py | 57 | ||||
-rw-r--r-- | numpy/testing/tests/test_utils.py | 40 |
2 files changed, 1 insertions, 96 deletions
diff --git a/numpy/testing/tests/test_doctesting.py b/numpy/testing/tests/test_doctesting.py deleted file mode 100644 index 92c2156d8..000000000 --- a/numpy/testing/tests/test_doctesting.py +++ /dev/null @@ -1,57 +0,0 @@ -""" Doctests for NumPy-specific nose/doctest modifications - -""" -#FIXME: None of these tests is run, because 'check' is not a recognized -# testing prefix. - -# try the #random directive on the output line -def check_random_directive(): - ''' - >>> 2+2 - <BadExample object at 0x084D05AC> #random: may vary on your system - ''' - -# check the implicit "import numpy as np" -def check_implicit_np(): - ''' - >>> np.array([1,2,3]) - array([1, 2, 3]) - ''' - -# there's some extraneous whitespace around the correct responses -def check_whitespace_enabled(): - ''' - # whitespace after the 3 - >>> 1+2 - 3 - - # whitespace before the 7 - >>> 3+4 - 7 - ''' - -def check_empty_output(): - """ Check that no output does not cause an error. - - This is related to nose bug 445; the numpy plugin changed the - doctest-result-variable default and therefore hit this bug: - http://code.google.com/p/python-nose/issues/detail?id=445 - - >>> a = 10 - """ - -def check_skip(): - """ Check skip directive - - The test below should not run - - >>> 1/0 #doctest: +SKIP - """ - - -if __name__ == '__main__': - # Run tests outside numpy test rig - import nose - from numpy.testing.noseclasses import NumpyDoctest - argv = ['', __file__, '--with-numpydoctest'] - nose.core.TestProgram(argv=argv, addplugins=[NumpyDoctest()]) diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 052cc3aa1..0aaa508ee 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -8,13 +8,12 @@ import weakref import numpy as np from numpy.testing import ( assert_equal, assert_array_equal, assert_almost_equal, - assert_array_almost_equal, assert_array_less, build_err_msg, raises, + assert_array_almost_equal, assert_array_less, build_err_msg, assert_raises, assert_warns, assert_no_warnings, assert_allclose, assert_approx_equal, assert_array_almost_equal_nulp, assert_array_max_ulp, clear_and_catch_warnings, suppress_warnings, assert_string_equal, assert_, tempdir, temppath, assert_no_gc_cycles, HAS_REFCOUNT ) -from numpy.core.overrides import ARRAY_FUNCTION_ENABLED class _GenericTest: @@ -191,8 +190,6 @@ class TestArrayEqual(_GenericTest): self._test_not_equal(a, b) self._test_not_equal(b, a) - @pytest.mark.skipif( - not ARRAY_FUNCTION_ENABLED, reason='requires __array_function__') def test_subclass_that_does_not_implement_npall(self): class MyArray(np.ndarray): def __array_function__(self, *args, **kwargs): @@ -793,41 +790,6 @@ class TestArrayAssertLess: self._assert_func(-ainf, x) -@pytest.mark.skip(reason="The raises decorator depends on Nose") -class TestRaises: - - def setup_method(self): - class MyException(Exception): - pass - - self.e = MyException - - def raises_exception(self, e): - raise e - - def does_not_raise_exception(self): - pass - - def test_correct_catch(self): - raises(self.e)(self.raises_exception)(self.e) # raises? - - def test_wrong_exception(self): - try: - raises(self.e)(self.raises_exception)(RuntimeError) # raises? - except RuntimeError: - return - else: - raise AssertionError("should have caught RuntimeError") - - def test_catch_no_raise(self): - try: - raises(self.e)(self.does_not_raise_exception)() # raises? - except AssertionError: - return - else: - raise AssertionError("should have raised an AssertionError") - - class TestWarns: def test_warn(self): |