summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorsgasse <sgasse@users.noreply.github.com>2020-03-22 10:10:14 +0100
committersgasse <sgasse@users.noreply.github.com>2020-03-22 13:21:12 +0100
commitebd4a90b26086985cda65f79fbfeb6449cb5ba6b (patch)
treedd199dbd1be68abf7856fbf89f41ecc2c27956c4 /numpy
parent1be88ff070cce6ac720804e861583682564f7e0d (diff)
downloadnumpy-ebd4a90b26086985cda65f79fbfeb6449cb5ba6b.tar.gz
TST: Add unit test for kwarg of np.einsum
Ensure that explicitly stating out=None does not raise an error in np.einsum, see #15776 and #15256.
Diffstat (limited to 'numpy')
-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