diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-03-27 09:26:43 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-03-29 11:41:35 -0600 |
commit | 157aedaa50d3c5fc74b45c79fb8b8c4b650217ac (patch) | |
tree | 3c537ff46b4e0c031e791aeb85487be2eb9c782d | |
parent | e4d678a2f5859d29a853d617e9e5bbd4b6241898 (diff) | |
download | numpy-157aedaa50d3c5fc74b45c79fb8b8c4b650217ac.tar.gz |
MAINT: Rearrange numpy/testing files.
This is to prepare for the switch to pytest.
* Rename `numpy/testing/nose_tools` to `numpy/testing/_private`.
* Redirect imports as needed.
* Copy `_testutils.py` from scipy to `numpy/testing/_private`.
* Rename `_testutils.py` to `_pytester.py` and remove unneeded bits.
-rw-r--r-- | numpy/distutils/__init__.py | 4 | ||||
-rw-r--r-- | numpy/testing/__init__.py | 11 | ||||
-rw-r--r-- | numpy/testing/_private/__init__.py (renamed from numpy/testing/nose_tools/__init__.py) | 0 | ||||
-rw-r--r-- | numpy/testing/_private/decorators.py (renamed from numpy/testing/nose_tools/decorators.py) | 0 | ||||
-rw-r--r-- | numpy/testing/_private/noseclasses.py (renamed from numpy/testing/nose_tools/noseclasses.py) | 0 | ||||
-rw-r--r-- | numpy/testing/_private/nosetester.py (renamed from numpy/testing/nose_tools/nosetester.py) | 0 | ||||
-rw-r--r-- | numpy/testing/_private/parameterized.py (renamed from numpy/testing/nose_tools/parameterized.py) | 0 | ||||
-rw-r--r-- | numpy/testing/_private/utils.py (renamed from numpy/testing/nose_tools/utils.py) | 0 | ||||
-rw-r--r-- | numpy/testing/decorators.py | 2 | ||||
-rw-r--r-- | numpy/testing/noseclasses.py | 2 | ||||
-rw-r--r-- | numpy/testing/nosetester.py | 2 | ||||
-rwxr-xr-x | numpy/testing/setup.py | 2 | ||||
-rw-r--r-- | numpy/testing/utils.py | 2 |
13 files changed, 15 insertions, 10 deletions
diff --git a/numpy/distutils/__init__.py b/numpy/distutils/__init__.py index 0450334ff..d5921b399 100644 --- a/numpy/distutils/__init__.py +++ b/numpy/distutils/__init__.py @@ -17,7 +17,7 @@ try: # Normally numpy is installed if the above import works, but an interrupted # in-place build could also have left a __config__.py. In that case the # next import may still fail, so keep it inside the try block. - from numpy.testing.nosetester import _numpy_tester + from numpy.testing import _numpy_tester test = _numpy_tester().test except ImportError: pass @@ -26,7 +26,7 @@ except ImportError: def customized_fcompiler(plat=None, compiler=None): from numpy.distutils.fcompiler import new_fcompiler c = new_fcompiler(plat=plat, compiler=compiler) - c.customize() + c.customize() return c def customized_ccompiler(plat=None, compiler=None): diff --git a/numpy/testing/__init__.py b/numpy/testing/__init__.py index 9485b455e..f4970b06b 100644 --- a/numpy/testing/__init__.py +++ b/numpy/testing/__init__.py @@ -9,7 +9,12 @@ from __future__ import division, absolute_import, print_function from unittest import TestCase -from . import decorators as dec -from .nosetester import run_module_suite, NoseTester as Tester, _numpy_tester -from .utils import * +from ._private.utils import * +from ._private import decorators as dec +from ._private.nosetester import ( + run_module_suite, NoseTester as Tester, _numpy_tester, + ) + +__all__ = _private.utils.__all__ + ['TestCase', 'run_module_suite'] + test = _numpy_tester().test diff --git a/numpy/testing/nose_tools/__init__.py b/numpy/testing/_private/__init__.py index e69de29bb..e69de29bb 100644 --- a/numpy/testing/nose_tools/__init__.py +++ b/numpy/testing/_private/__init__.py diff --git a/numpy/testing/nose_tools/decorators.py b/numpy/testing/_private/decorators.py index dee832404..dee832404 100644 --- a/numpy/testing/nose_tools/decorators.py +++ b/numpy/testing/_private/decorators.py diff --git a/numpy/testing/nose_tools/noseclasses.py b/numpy/testing/_private/noseclasses.py index 08dec0ca9..08dec0ca9 100644 --- a/numpy/testing/nose_tools/noseclasses.py +++ b/numpy/testing/_private/noseclasses.py diff --git a/numpy/testing/nose_tools/nosetester.py b/numpy/testing/_private/nosetester.py index c2cf58377..c2cf58377 100644 --- a/numpy/testing/nose_tools/nosetester.py +++ b/numpy/testing/_private/nosetester.py diff --git a/numpy/testing/nose_tools/parameterized.py b/numpy/testing/_private/parameterized.py index 53e67517d..53e67517d 100644 --- a/numpy/testing/nose_tools/parameterized.py +++ b/numpy/testing/_private/parameterized.py diff --git a/numpy/testing/nose_tools/utils.py b/numpy/testing/_private/utils.py index 507ecb1e2..507ecb1e2 100644 --- a/numpy/testing/nose_tools/utils.py +++ b/numpy/testing/_private/utils.py diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py index 21bcdd798..f76ee6632 100644 --- a/numpy/testing/decorators.py +++ b/numpy/testing/decorators.py @@ -5,4 +5,4 @@ set of tools """ import os -from .nose_tools.decorators import * +from ._private.decorators import * diff --git a/numpy/testing/noseclasses.py b/numpy/testing/noseclasses.py index 144c4e7e4..7c0a5b7f6 100644 --- a/numpy/testing/noseclasses.py +++ b/numpy/testing/noseclasses.py @@ -2,4 +2,4 @@ Back compatibility noseclasses module. It will import the appropriate set of tools """ -from .nose_tools.noseclasses import *
\ No newline at end of file +from ._private.noseclasses import * diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index 949fae03e..b7c009f12 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -5,7 +5,7 @@ set of tools """ import os -from .nose_tools.nosetester import * +from ._private.nosetester import * __all__ = ['get_package_name', 'run_module_suite', 'NoseTester', diff --git a/numpy/testing/setup.py b/numpy/testing/setup.py index 5a0f977d9..b00e5e029 100755 --- a/numpy/testing/setup.py +++ b/numpy/testing/setup.py @@ -6,7 +6,7 @@ def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('testing', parent_package, top_path) - config.add_subpackage('nose_tools') + config.add_subpackage('_private') config.add_subpackage('pytest_tools') config.add_data_dir('tests') return config diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index a0218c4e6..914fc6806 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -5,7 +5,7 @@ set of tools """ import os -from .nose_tools.utils import * +from ._private.utils import * __all__ = [ 'assert_equal', 'assert_almost_equal', 'assert_approx_equal', |