diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2019-12-06 11:03:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-06 11:03:03 -0800 |
commit | f6a7a440669c6f386a1b15e081c6db740bb87a88 (patch) | |
tree | eececcc92e1c14eb08d46591ec7aab5932b9ea31 /numpy/lib | |
parent | abde0a775e19b9f84cb3930f065cdf07f94f8526 (diff) | |
download | numpy-f6a7a440669c6f386a1b15e081c6db740bb87a88.tar.gz |
Revert "DEP: issue deprecation warning when creating ragged array (NEP 34)"revert-14794-nep-0034-impl
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/tests/test_arraypad.py | 33 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 2 |
2 files changed, 15 insertions, 20 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py index 1c3507a62..65593dd29 100644 --- a/numpy/lib/tests/test_arraypad.py +++ b/numpy/lib/tests/test_arraypad.py @@ -1262,29 +1262,24 @@ class TestPadWidth(object): with pytest.raises(ValueError, match=match): np.pad(arr, pad_width, mode) - @pytest.mark.parametrize("pad_width, dtype", [ - ("3", None), - ("word", None), - (None, None), - (object(), None), - (3.4, None), - (((2, 3, 4), (3, 2)), object), - (complex(1, -1), None), - (((-2.1, 3), (3, 2)), None), + @pytest.mark.parametrize("pad_width", [ + "3", + "word", + None, + object(), + 3.4, + ((2, 3, 4), (3, 2)), # dtype=object (tuple) + complex(1, -1), + ((-2.1, 3), (3, 2)), ]) @pytest.mark.parametrize("mode", _all_modes.keys()) - def test_bad_type(self, pad_width, dtype, mode): + def test_bad_type(self, pad_width, mode): arr = np.arange(30).reshape((6, 5)) match = "`pad_width` must be of integral type." - if dtype is not None: - # avoid DeprecationWarning when not specifying dtype - with pytest.raises(TypeError, match=match): - np.pad(arr, np.array(pad_width, dtype=dtype), mode) - else: - with pytest.raises(TypeError, match=match): - np.pad(arr, pad_width, mode) - with pytest.raises(TypeError, match=match): - np.pad(arr, np.array(pad_width), mode) + with pytest.raises(TypeError, match=match): + np.pad(arr, pad_width, mode) + with pytest.raises(TypeError, match=match): + np.pad(arr, np.array(pad_width), mode) def test_pad_width_as_ndarray(self): a = np.arange(12) diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 39fe40685..a095e250a 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -580,7 +580,7 @@ class TestSaveTxt(object): def test_large_zip(self): # The test takes at least 6GB of memory, writes a file larger than 4GB test_data = np.asarray([np.random.rand(np.random.randint(50,100),4) - for i in range(800000)], dtype=object) + for i in range(800000)]) with tempdir() as tmpdir: np.savez(os.path.join(tmpdir, 'test.npz'), test_data=test_data) |