From ae84af3b6e6d96e4be408e8a56408290ee1879db Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Tue, 4 Jul 2017 13:47:45 -0600 Subject: MAINT: Rearrange files in numpy/testing module. The aim here is to separate out the nose dependent files prior to adding pytest support. This could be done by adding new files to the general numpy/testing directory, but I felt that it was to have the relevant files separated out as it makes it easier to completely remove nose dependencies when needed. Many places were accessing submodules in numpy/testing directly, and in some cases incorrectly. That presented a backwards compatibility problem. The solution adapted here is to have "dummy" files whose contents will depend on whether of not pytest is active. That way the module looks the same as before from the outside. In the case of numpy itself, direct accesses have been fixed. Having proper `__all__` lists in the submodules helped in that. --- numpy/ma/testutils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'numpy/ma/testutils.py') 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): -- cgit v1.2.1