diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-07-06 14:31:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-06 14:31:01 -0600 |
commit | 698ddea57384e12bbdea18592b36b33566ca49b0 (patch) | |
tree | 069bf63c590b4b38527f9baa1147fb843b6b89ac /numpy/ma | |
parent | 1b5f61ead26ace5809811920ebaad1aee409c7b5 (diff) | |
parent | 974ce6f144e79d5edf7076e14cf35c01c97536dc (diff) | |
download | numpy-698ddea57384e12bbdea18592b36b33566ca49b0.tar.gz |
Merge pull request #9362 from charris/rearrange-testing-module
ENH: Rearrange testing module to isolate nose dependency.
Diffstat (limited to 'numpy/ma')
-rw-r--r-- | numpy/ma/__init__.py | 2 | ||||
-rw-r--r-- | numpy/ma/tests/test_core.py | 7 | ||||
-rw-r--r-- | numpy/ma/testutils.py | 12 | ||||
-rw-r--r-- | numpy/ma/timer_comparison.py | 2 |
4 files changed, 12 insertions, 11 deletions
diff --git a/numpy/ma/__init__.py b/numpy/ma/__init__.py index af3468b01..fbefc47a4 100644 --- a/numpy/ma/__init__.py +++ b/numpy/ma/__init__.py @@ -51,6 +51,6 @@ __all__ = ['core', 'extras'] __all__ += core.__all__ __all__ += extras.__all__ -from numpy.testing.nosetester import _numpy_tester +from numpy.testing import _numpy_tester test = _numpy_tester().test bench = _numpy_tester().bench diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index dc1d74790..c8bcb758d 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -20,7 +20,8 @@ import numpy.ma.core import numpy.core.fromnumeric as fromnumeric import numpy.core.umath as umath from numpy.testing import ( - TestCase, run_module_suite, assert_raises, assert_warns, suppress_warnings) + TestCase, run_module_suite, assert_raises, assert_warns, suppress_warnings + ) from numpy import ndarray from numpy.compat import asbytes, asbytes_nested from numpy.ma.testutils import ( @@ -1877,11 +1878,11 @@ class TestFillingValues(TestCase): "h", "D", "W", "M", "Y"): control = numpy.datetime64("NaT", timecode) test = default_fill_value(numpy.dtype("<M8[" + timecode + "]")) - np.testing.utils.assert_equal(test, control) + np.testing.assert_equal(test, control) control = numpy.timedelta64("NaT", timecode) test = default_fill_value(numpy.dtype("<m8[" + timecode + "]")) - np.testing.utils.assert_equal(test, control) + np.testing.assert_equal(test, control) def test_extremum_fill_value(self): # Tests extremum fill values for flexible type. diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py index c19066d71..a95c170c8 100644 --- a/numpy/ma/testutils.py +++ b/numpy/ma/testutils.py @@ -12,11 +12,11 @@ import operator import numpy as np 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_raises, build_err_msg, run_module_suite ) -import numpy.testing.utils as utils from .core import mask_or, getmask, masked_array, nomask, masked, filled __all__masked = [ @@ -211,11 +211,11 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header='', header=header, names=('x', 'y')) raise ValueError(msg) # OK, now run the basic tests on filled versions - return utils.assert_array_compare(comparison, - x.filled(fill_value), - y.filled(fill_value), - err_msg=err_msg, - verbose=verbose, header=header) + return np.testing.assert_array_compare(comparison, + x.filled(fill_value), + y.filled(fill_value), + err_msg=err_msg, + verbose=verbose, header=header) def assert_array_equal(x, y, err_msg='', verbose=True): diff --git a/numpy/ma/timer_comparison.py b/numpy/ma/timer_comparison.py index dae4b141b..68104ed0a 100644 --- a/numpy/ma/timer_comparison.py +++ b/numpy/ma/timer_comparison.py @@ -7,7 +7,7 @@ import numpy as np from numpy import float_ import numpy.core.fromnumeric as fromnumeric -from numpy.testing.utils import build_err_msg +from numpy.testing import build_err_msg # Fixme: this does not look right. np.seterr(all='ignore') |