summaryrefslogtreecommitdiff
path: root/numpy/tests
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-02-03 12:04:46 -0800
committerEric Wieser <wieser.eric@gmail.com>2018-02-03 20:44:55 -0800
commit1271e17ea6ca8abe12f7dd045ac0af8674f594d4 (patch)
treee91980324d59b95b0f698de3f8a2d9f9fa7a9c45 /numpy/tests
parent2854d508d1c6d211f2ce99e8747eda1cb427a78a (diff)
downloadnumpy-1271e17ea6ca8abe12f7dd045ac0af8674f594d4.tar.gz
ENH: Add a repr to np._NoValue
This change _NoValue from a class to an instance, which is more inline with the builtin None. Fixes gh-8991, closes gh-9592
Diffstat (limited to 'numpy/tests')
-rw-r--r--numpy/tests/test_reloading.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/tests/test_reloading.py b/numpy/tests/test_reloading.py
index ca651c874..4481d76ef 100644
--- a/numpy/tests/test_reloading.py
+++ b/numpy/tests/test_reloading.py
@@ -1,8 +1,9 @@
from __future__ import division, absolute_import, print_function
import sys
+import pickle
-from numpy.testing import assert_raises, assert_, run_module_suite
+from numpy.testing import assert_raises, assert_, assert_equal, run_module_suite
if sys.version_info[:2] >= (3, 4):
from importlib import reload
@@ -29,6 +30,11 @@ def test_numpy_reloading():
assert_(ModuleDeprecationWarning is np.ModuleDeprecationWarning)
assert_(VisibleDeprecationWarning is np.VisibleDeprecationWarning)
+def test_novalue():
+ import numpy as np
+ assert_equal(repr(np._NoValue), '<no value>')
+ assert_(pickle.loads(pickle.dumps(np._NoValue)) is np._NoValue)
+
if __name__ == "__main__":
run_module_suite()