summaryrefslogtreecommitdiff
path: root/numpy/tests/test_reloading.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/tests/test_reloading.py')
-rw-r--r--numpy/tests/test_reloading.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/numpy/tests/test_reloading.py b/numpy/tests/test_reloading.py
index 141e11f6c..ca651c874 100644
--- a/numpy/tests/test_reloading.py
+++ b/numpy/tests/test_reloading.py
@@ -2,7 +2,6 @@ from __future__ import division, absolute_import, print_function
import sys
-import numpy as np
from numpy.testing import assert_raises, assert_, run_module_suite
if sys.version_info[:2] >= (3, 4):
@@ -10,13 +9,22 @@ if sys.version_info[:2] >= (3, 4):
else:
from imp import reload
-def test_reloading_exception():
+def test_numpy_reloading():
# gh-7844. Also check that relevant globals retain their identity.
+ import numpy as np
+ import numpy._globals
+
_NoValue = np._NoValue
VisibleDeprecationWarning = np.VisibleDeprecationWarning
ModuleDeprecationWarning = np.ModuleDeprecationWarning
- assert_raises(RuntimeError, reload, np)
+ reload(np)
+ assert_(_NoValue is np._NoValue)
+ assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
+ assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)
+
+ assert_raises(RuntimeError, reload, numpy._globals)
+ reload(np)
assert_(_NoValue is np._NoValue)
assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)