From ed6c0dd342c7d6def2600db00c3eaf75e16a39d2 Mon Sep 17 00:00:00 2001 From: xoviat Date: Wed, 28 Feb 2018 17:59:07 -0600 Subject: MAINT: Remove use of unittest in NumPy tests. This removes a few left over uses of unittest. The main changes apart from removal of Test case are: * `setUp` replaced by nose and pytest compatible `setup` * `tearDown` replaced by nose and pytest compatible `teardown` * `assertRaises` replaced by `assert_raises` * `assertEqual` replaced by `assert_equal` The last two are in `numpy/testings/tests/test_utils.py`, so may seem a but circular, but at least are limited to those two functions. The use of `setup` and `teardown`, can be fixed up with the pytest equivalents after we have switched to pytest. --- numpy/ma/testutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'numpy/ma/testutils.py') diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py index a95c170c8..c4ee639ed 100644 --- a/numpy/ma/testutils.py +++ b/numpy/ma/testutils.py @@ -14,7 +14,7 @@ from numpy import ndarray, float_ import numpy.core.umath as umath import numpy.testing from numpy.testing import ( - TestCase, assert_, assert_allclose, assert_array_almost_equal_nulp, + assert_, assert_allclose, assert_array_almost_equal_nulp, assert_raises, build_err_msg, run_module_suite ) from .core import mask_or, getmask, masked_array, nomask, masked, filled @@ -31,6 +31,7 @@ __all__masked = [ # have mistakenly included them from this file. SciPy is one. That is # unfortunate, as some of these functions are not intended to work with # masked arrays. But there was no way to tell before. +from unittest import TestCase __some__from_testing = [ 'TestCase', 'assert_', 'assert_allclose', 'assert_array_almost_equal_nulp', 'assert_raises', 'run_module_suite', -- cgit v1.2.1