summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2020-03-24 18:14:06 -0500
committerGitHub <noreply@github.com>2020-03-24 18:14:06 -0500
commitfed47a489e3da26fffb98a6dda32dbc9ba0f63c3 (patch)
tree737da4999616bcffc3783423ac45aedf61890d6e
parent54c2a266780c02852003330f59bf3bf20e36eaa0 (diff)
parentebd4a90b26086985cda65f79fbfeb6449cb5ba6b (diff)
downloadnumpy-fed47a489e3da26fffb98a6dda32dbc9ba0f63c3.tar.gz
Merge pull request #15797 from sgasse/add_einsum_test
TST: Add unit test for out=None of np.einsum
-rw-r--r--numpy/core/tests/test_einsum.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/tests/test_einsum.py b/numpy/core/tests/test_einsum.py
index 6ec61fb1d..fd0de8732 100644
--- a/numpy/core/tests/test_einsum.py
+++ b/numpy/core/tests/test_einsum.py
@@ -605,6 +605,10 @@ class TestEinsum:
[[[1, 3], [3, 9], [5, 15], [7, 21]],
[[8, 16], [16, 32], [24, 48], [32, 64]]])
+ # Ensure explicitly setting out=None does not cause an error
+ # see issue gh-15776 and issue gh-15256
+ assert_equal(np.einsum('i,j', [1], [2], out=None), [[2]])
+
def test_subscript_range(self):
# Issue #7741, make sure that all letters of Latin alphabet (both uppercase & lowercase) can be used
# when creating a subscript from arrays