diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-03-27 09:41:03 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-03-29 11:41:35 -0600 |
commit | 2589616ca6a9b6270c9621af038d90972154914b (patch) | |
tree | aa9356e346b85396821a616b134a2dff390b30a5 /numpy | |
parent | 157aedaa50d3c5fc74b45c79fb8b8c4b650217ac (diff) | |
download | numpy-2589616ca6a9b6270c9621af038d90972154914b.tar.gz |
MAINT: Warn when importing numpy.testing.<module>.
Downstream projects were importing directly from the testing modules
rather than from testing. Discourage this.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/testing/decorators.py | 5 | ||||
-rw-r--r-- | numpy/testing/noseclasses.py | 6 | ||||
-rw-r--r-- | numpy/testing/nosetester.py | 6 | ||||
-rw-r--r-- | numpy/testing/utils.py | 5 |
4 files changed, 18 insertions, 4 deletions
diff --git a/numpy/testing/decorators.py b/numpy/testing/decorators.py index f76ee6632..8f6eb3ce8 100644 --- a/numpy/testing/decorators.py +++ b/numpy/testing/decorators.py @@ -3,6 +3,9 @@ Back compatibility decorators module. It will import the appropriate set of tools """ -import os +import warnings + +warnings.warn(ImportWarning, + "Import from numpy.testing, not numpy.testing.decorators") from ._private.decorators import * diff --git a/numpy/testing/noseclasses.py b/numpy/testing/noseclasses.py index 7c0a5b7f6..9431fc6f1 100644 --- a/numpy/testing/noseclasses.py +++ b/numpy/testing/noseclasses.py @@ -2,4 +2,10 @@ Back compatibility noseclasses module. It will import the appropriate set of tools """ +import warnings + +warnings.warn(ImportWarning, + "Import from numpy.testing, not numpy.testing.noseclasses") + from ._private.noseclasses import * + diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py index b7c009f12..74d159946 100644 --- a/numpy/testing/nosetester.py +++ b/numpy/testing/nosetester.py @@ -3,10 +3,12 @@ Back compatibility nosetester module. It will import the appropriate set of tools """ -import os +import warnings -from ._private.nosetester import * +warnings.warn(ImportWarning, + "Import from numpy.testing, not numpy.testing.nosetester") +from ._private.nosetester import * __all__ = ['get_package_name', 'run_module_suite', 'NoseTester', '_numpy_tester', 'get_package_name', 'import_nose', diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index 914fc6806..299c68c6a 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -3,7 +3,10 @@ Back compatibility utils module. It will import the appropriate set of tools """ -import os +import warnings + +warnings.warn(ImportWarning, + "Import from numpy.testing, not numpy.testing.utils") from ._private.utils import * |