From b733a10a9cc806f4772728015ec1bd9e63322858 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 4 Jul 2015 23:37:03 -0600 Subject: STY,MAINT: Run pyflakes and pep8 on numpy/ma/tests/*. Also fix "*" imports. The formatting of test arrays is not fixed for multiple spaces following "," and other violations that are common in tests. To be precise, E241 and E201 are added to the errors that are excluded. --- numpy/ma/testutils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'numpy/ma/testutils.py') diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py index 2af39d6b4..d1adc439e 100644 --- a/numpy/ma/testutils.py +++ b/numpy/ma/testutils.py @@ -16,7 +16,7 @@ from numpy.testing import assert_, build_err_msg import numpy.testing.utils as utils from .core import mask_or, getmask, masked_array, nomask, masked, filled -__all__ = [ +__all__masked = [ 'almost', 'approx', 'assert_almost_equal', 'assert_array_almost_equal', 'assert_array_approx_equal', 'assert_array_compare', 'assert_array_equal', 'assert_array_less', 'assert_close', @@ -24,6 +24,18 @@ __all__ = [ 'assert_not_equal', 'fail_if_array_equal', ] +# Include some normal test functions to avoid breaking other projects who +# have mistakenly included them from this file. SciPy is one. That was a +# bad idea, as some of these functions are not intended to work with masked +# arrays, but there was no way to tell before. +__all__from_testing = [ + 'TestCase', 'assert_', 'assert_allclose', + 'assert_array_almost_equal_nulp', 'assert_raises', 'run_modules_suite', + ] + +__all__ = __all__masked + + def approx(a, b, fill_value=True, rtol=1e-5, atol=1e-8): """ Returns true if all components of a and b are equal to given tolerances. -- cgit v1.2.1