diff --git a/numpy/compat/tests/test_compat.py b/numpy/compat/tests/test_compat.py index f2bba59e629c..9822ab374201 100644 --- a/numpy/compat/tests/test_compat.py +++ b/numpy/compat/tests/test_compat.py @@ -1,7 +1,7 @@ from os.path import join from numpy.compat import isfileobj -from numpy.testing import assert_ +from numpy.testing import assert_, run_module_suite from numpy.testing.utils import tempdir @@ -17,3 +17,7 @@ def test_isfileobj(): with open(filename, 'rb') as f: assert_(isfileobj(f)) + + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/core/tests/test_abc.py b/numpy/core/tests/test_abc.py index 54edd7e9011c..2430866fdf82 100644 --- a/numpy/core/tests/test_abc.py +++ b/numpy/core/tests/test_abc.py @@ -1,7 +1,6 @@ from __future__ import division, absolute_import, print_function -import numpy as np -from numpy.testing import TestCase, assert_ +from numpy.testing import TestCase, assert_, run_module_suite import numbers from numpy.core.numerictypes import sctypes @@ -43,3 +42,6 @@ def test_uint(self): assert_(issubclass(t, numbers.Integral), "{0} is not subclass of Integral".format(t.__name__)) + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/core/tests/test_blasdot.py b/numpy/core/tests/test_blasdot.py index caa576abcf7e..17f77d2f5b4f 100644 --- a/numpy/core/tests/test_blasdot.py +++ b/numpy/core/tests/test_blasdot.py @@ -4,7 +4,8 @@ import sys from numpy.core import zeros, float64 from numpy.testing import dec, TestCase, assert_almost_equal, assert_, \ - assert_raises, assert_array_equal, assert_allclose, assert_equal + assert_raises, assert_array_equal, assert_allclose, assert_equal, \ + run_module_suite from numpy.core.multiarray import inner as inner_ DECPREC = 14 @@ -169,3 +170,7 @@ def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs): assert_equal(c.dot(a), "A") assert_raises(TypeError, np.dot, b, c) assert_raises(TypeError, c.dot, b) + + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/core/tests/test_function_base.py b/numpy/core/tests/test_function_base.py index f6ffd5a1048a..e8f9fb755ec1 100644 --- a/numpy/core/tests/test_function_base.py +++ b/numpy/core/tests/test_function_base.py @@ -108,4 +108,8 @@ def __rdiv__(self, x): a = PhysicalQuantity(0.0) b = PhysicalQuantity(1.0) - assert_equal(linspace(a, b), linspace(0.0, 1.0)) \ No newline at end of file + assert_equal(linspace(a, b), linspace(0.0, 1.0)) + + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/core/tests/test_multiarray_assignment.py b/numpy/core/tests/test_multiarray_assignment.py index 65a09086bc2a..86e1b125e752 100644 --- a/numpy/core/tests/test_multiarray_assignment.py +++ b/numpy/core/tests/test_multiarray_assignment.py @@ -1,7 +1,7 @@ from __future__ import division, absolute_import, print_function import numpy as np -from numpy.testing import TestCase +from numpy.testing import run_module_suite ndims = 2 size = 10 @@ -78,3 +78,7 @@ def test_overlapping_assignments(): dstidx = tuple([a[1] for a in ind]) yield _check_assignment, srcidx, dstidx + + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py index 0d237c81cb86..6e93dae6c219 100644 --- a/numpy/linalg/tests/test_build.py +++ b/numpy/linalg/tests/test_build.py @@ -1,12 +1,11 @@ from __future__ import division, absolute_import, print_function -from subprocess import call, PIPE, Popen +from subprocess import PIPE, Popen import sys import re -import numpy as np from numpy.linalg import lapack_lite -from numpy.testing import TestCase, dec +from numpy.testing import TestCase, dec, run_module_suite from numpy.compat import asbytes_nested @@ -51,3 +50,6 @@ def test_lapack(self): """Both g77 and gfortran runtimes linked in lapack_lite ! This is likely to cause random crashes and wrong results. See numpy INSTALL.txt for more information.""") + +if __name__ == "__main__": + run_module_suite() diff --git a/numpy/matrixlib/tests/test_multiarray.py b/numpy/matrixlib/tests/test_multiarray.py index fc5b1df17d7e..64d63f125f81 100644 --- a/numpy/matrixlib/tests/test_multiarray.py +++ b/numpy/matrixlib/tests/test_multiarray.py @@ -16,3 +16,6 @@ def test_keywords(self): assert_(isinstance(y, np.matrix)) assert_equal(y.dtype, np.dtype('