summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-03-11 10:53:27 -0700
committerGitHub <noreply@github.com>2020-03-11 10:53:27 -0700
commitb074b21c326ecaa6b6519fc7dfcf54fa4e4457af (patch)
tree37c463c354ec01c54f01bd6070ba96166ebb3211 /numpy/lib/tests/test_function_base.py
parent59a97520cf0aa68b92a775d809e1cb67d886b50c (diff)
downloadnumpy-b074b21c326ecaa6b6519fc7dfcf54fa4e4457af.tar.gz
ENH: Add `subok` parameter to np.copy function (cf. gfh6509) (gh-15685)
This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting. This PR closes #3474 and #15570
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 751a7a212..860cf452b 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -273,6 +273,13 @@ class TestCopy:
assert_(not a_fort_copy.flags.c_contiguous)
assert_(a_fort_copy.flags.f_contiguous)
+ def test_subok(self):
+ mx = ma.ones(5)
+ assert_(not ma.isMaskedArray(np.copy(mx, subok=False)))
+ assert_(ma.isMaskedArray(np.copy(mx, subok=True)))
+ # Default behavior
+ assert_(not ma.isMaskedArray(np.copy(mx)))
+
class TestAverage: