diff options
author | Pierre Glaser <pierreglaser@msn.com> | 2018-09-19 17:07:25 +0200 |
---|---|---|
committer | Pierre Glaser <pierreglaser@msn.com> | 2018-10-10 14:53:45 +0200 |
commit | 7372f8dcc6af4446e502c0daec3199dace27e863 (patch) | |
tree | cc9f39762defb52b875ca4e969cb9498a25aa4b4 /numpy/tests | |
parent | 86a7acc8582923604fac849bb19f0b08efc0a91a (diff) | |
download | numpy-7372f8dcc6af4446e502c0daec3199dace27e863.tar.gz |
MAINT, TST import pickle from numpy.core.numeric
All imports of pickle from numpy modules are now done this way:
>>> from numpy.core.numeric import pickle
Also, some loops on protocol numbers are added over pickle tests that
were not caught from #12090
Diffstat (limited to 'numpy/tests')
-rw-r--r-- | numpy/tests/test_reloading.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/tests/test_reloading.py b/numpy/tests/test_reloading.py index cd42252e3..a073d691f 100644 --- a/numpy/tests/test_reloading.py +++ b/numpy/tests/test_reloading.py @@ -1,9 +1,9 @@ from __future__ import division, absolute_import, print_function import sys -import pickle from numpy.testing import assert_raises, assert_, assert_equal +from numpy.core.numeric import pickle if sys.version_info[:2] >= (3, 4): from importlib import reload @@ -32,5 +32,7 @@ def test_numpy_reloading(): def test_novalue(): import numpy as np - assert_equal(repr(np._NoValue), '<no value>') - assert_(pickle.loads(pickle.dumps(np._NoValue)) is np._NoValue) + for proto in range(2, pickle.HIGHEST_PROTOCOL + 1): + assert_equal(repr(np._NoValue), '<no value>') + assert_(pickle.loads(pickle.dumps(np._NoValue, + protocol=proto)) is np._NoValue) |