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/distutils/tests/test_system_info.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'numpy/distutils/tests/test_system_info.py') diff --git a/numpy/distutils/tests/test_system_info.py b/numpy/distutils/tests/test_system_info.py index 12bafd7bf..59b4cc125 100644 --- a/numpy/distutils/tests/test_system_info.py +++ b/numpy/distutils/tests/test_system_info.py @@ -7,8 +7,9 @@ from subprocess import Popen, PIPE from distutils.errors import DistutilsError from numpy.distutils import ccompiler -from numpy.testing import TestCase, run_module_suite, assert_, assert_equal -from numpy.testing.decorators import skipif +from numpy.testing import ( + TestCase, run_module_suite, assert_, assert_equal, dec + ) from numpy.distutils.system_info import system_info, ConfigParser from numpy.distutils.system_info import default_lib_dirs, default_include_dirs @@ -199,7 +200,7 @@ class TestSystemInfoReading(TestCase): extra = tsi.calc_extra_info() assert_equal(extra['extra_link_args'], ['-Wl,-rpath=' + self._lib2]) - @skipif(not HAVE_COMPILER) + @dec.skipif(not HAVE_COMPILER) def test_compile1(self): # Compile source and link the first source c = ccompiler.new_compiler() @@ -215,8 +216,8 @@ class TestSystemInfoReading(TestCase): finally: os.chdir(previousDir) - @skipif(not HAVE_COMPILER) - @skipif('msvc' in repr(ccompiler.new_compiler())) + @dec.skipif(not HAVE_COMPILER) + @dec.skipif('msvc' in repr(ccompiler.new_compiler())) def test_compile2(self): # Compile source and link the second source tsi = self.c_temp2 -- cgit v1.2.1