diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2022-05-04 21:01:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 21:01:04 +0200 |
commit | c62930f9ec6de9d03e8622c344bbdadece2b1af7 (patch) | |
tree | 75b04ab44e94f3ea1b990fdf88d10f97257abd3e /numpy | |
parent | f9089b301f7d8cedefb63f23fc337114c1990a02 (diff) | |
parent | 0a9634c87b04b15b75e2906387b56892cd91b656 (diff) | |
download | numpy-c62930f9ec6de9d03e8622c344bbdadece2b1af7.tar.gz |
Merge pull request #21425 from mattip/skip-pypy
TEST: on PyPy, skip hanging slow test and require-mem on second [wheel build]
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/lib/tests/test_format.py | 9 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index 78e67a89b..cf35e1563 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -285,6 +285,7 @@ from numpy.testing import ( assert_, assert_array_equal, assert_raises, assert_raises_regex, assert_warns, ) +from numpy.testing._private.utils import requires_memory from numpy.lib import format @@ -879,11 +880,13 @@ def test_large_file_support(tmpdir): @pytest.mark.skipif(np.dtype(np.intp).itemsize < 8, reason="test requires 64-bit system") @pytest.mark.slow +@requires_memory(free_bytes=2 * 2**30) def test_large_archive(tmpdir): # Regression test for product of saving arrays with dimensions of array # having a product that doesn't fit in int32. See gh-7598 for details. + shape = (2**30, 2) try: - a = np.empty((2**30, 2), dtype=np.uint8) + a = np.empty(shape, dtype=np.uint8) except MemoryError: pytest.skip("Could not create large file") @@ -892,10 +895,12 @@ def test_large_archive(tmpdir): with open(fname, "wb") as f: np.savez(f, arr=a) + del a + with open(fname, "rb") as f: new_a = np.load(f)["arr"] - assert_(a.shape == new_a.shape) + assert new_a.shape == shape def test_empty_npz(tmpdir): diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index a2758123b..38a751d11 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -203,6 +203,7 @@ class TestSavezLoad(RoundtripTest): self.arr_reloaded.fid.close() os.remove(self.arr_reloaded.fid.name) + @pytest.mark.skipif(IS_PYPY, reason="Hangs on PyPy") @pytest.mark.skipif(not IS_64BIT, reason="Needs 64bit platform") @pytest.mark.slow def test_big_arrays(self): |