diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-03-24 13:30:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 13:30:19 +0000 |
commit | 7d0b3efe4b38fb5b5ba7367741b55d7655037ad0 (patch) | |
tree | 52510609bfb3698af07468c65efff570ddc5d999 /numpy/lib/tests/test_function_base.py | |
parent | b3f41eeafd2708a6b519cf3c7ba3576dfa1cc5b3 (diff) | |
parent | f0e37e8088e55307ad33791a03cb3989f1b8118c (diff) | |
download | numpy-7d0b3efe4b38fb5b5ba7367741b55d7655037ad0.tar.gz |
Merge pull request #15802 from eric-wieser/simplify-insert
DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an error
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 04b280038..fb10205d4 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -509,12 +509,11 @@ class TestInsert: insert(a, 1, a[:, 2, :], axis=1)) def test_0d(self): - # This is an error in the future a = np.array(1) - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', DeprecationWarning) - assert_equal(insert(a, [], 2, axis=0), np.array(2)) - assert_(w[0].category is DeprecationWarning) + with pytest.raises(np.AxisError): + insert(a, [], 2, axis=0) + with pytest.raises(TypeError): + insert(a, [], 2, axis="nonsense") def test_subclass(self): class SubClass(np.ndarray): @@ -852,10 +851,10 @@ class TestDelete: def test_0d(self): a = np.array(1) - with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings('always', '', DeprecationWarning) - assert_equal(delete(a, [], axis=0), a) - assert_(w[0].category is DeprecationWarning) + with pytest.raises(np.AxisError): + delete(a, [], axis=0) + with pytest.raises(TypeError): + delete(a, [], axis="nonsense") def test_subclass(self): class SubClass(np.ndarray): |