diff options
author | Kritika Jalan <krithi710@gmail.com> | 2018-05-26 11:21:33 +0530 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-05-25 22:51:33 -0700 |
commit | c1fc882277bcec42e11f67c6eced43d68cec4d7a (patch) | |
tree | 943318523efd2998fe4581c0a4652ea684cb2493 /numpy/ma/tests | |
parent | 0bd86db79b7a8000f9dbd401df722ffae9c2b33c (diff) | |
download | numpy-c1fc882277bcec42e11f67c6eced43d68cec4d7a.tar.gz |
BUG: __copy__ and __deepcopy__ should preserve MaskedConstant (#11038)
Fixes #11021
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r-- | numpy/ma/tests/test_core.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 63703f6cd..4c7440aab 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -4826,6 +4826,16 @@ class TestMaskedConstant(object): np.ma.masked.copy() is np.ma.masked, np.True_.copy() is np.True_) + def test__copy(self): + import copy + assert_( + copy.copy(np.ma.masked) is np.ma.masked) + + def test_deepcopy(self): + import copy + assert_( + copy.deepcopy(np.ma.masked) is np.ma.masked) + def test_immutable(self): orig = np.ma.masked assert_raises(np.ma.core.MaskError, operator.setitem, orig, (), 1) |