summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-03-18 16:35:36 -0500
committerSebastian Berg <sebastian@sipsolutions.net>2021-03-18 16:35:36 -0500
commitd7af05a849b3b81922ec3da988494a70a875ca91 (patch)
treee9db30b5ce487b25abd0bba719cf2e6cccfe95a8
parentb2190e837e20f3720809791ccb4ba6f9d080f642 (diff)
downloadnumpy-d7af05a849b3b81922ec3da988494a70a875ca91.tar.gz
TST: Add minimal test for passing an out argument to arr.conjugate()
This can currently only be passed positionally, and this is undocumented.
-rw-r--r--numpy/core/tests/test_multiarray.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index b30fcb812..0b6114097 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -3390,6 +3390,15 @@ class TestMethods:
assert_raises(TypeError, lambda: a.conj())
assert_raises(TypeError, lambda: a.conjugate())
+ def test_conjugate_out(self):
+ # Minimal test for the out argument being passed on correctly
+ # NOTE: The ability to pass `out` is currently undocumented!
+ a = np.array([1-1j, 1+1j, 23+23.0j])
+ out = np.empty_like(a)
+ res = a.conjugate(out)
+ assert res is out
+ assert_array_equal(out, a.conjugate())
+
def test__complex__(self):
dtypes = ['i1', 'i2', 'i4', 'i8',
'u1', 'u2', 'u4', 'u8',