summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2019-12-01 14:23:33 +0200
committerPauli Virtanen <pav@iki.fi>2019-12-01 16:37:50 +0200
commit2ae28b0df570768c9c685e8ba8ee71c4717c902a (patch)
tree8b1f3b17ca4ee0c4511c4777be8097a737830300 /numpy/lib
parentb83f10ef7ee766bf30ccfa563b6cc8f7fd38a4c8 (diff)
downloadnumpy-2ae28b0df570768c9c685e8ba8ee71c4717c902a.tar.gz
TST: add pytest machinery to specify memory requirements for tests
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/tests/test_io.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index 6e2291ca3..66d6a5b00 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -24,6 +24,7 @@ from numpy.testing import (
assert_allclose, assert_array_equal, temppath, tempdir, IS_PYPY,
HAS_REFCOUNT, suppress_warnings, assert_no_gc_cycles, assert_no_warnings
)
+from numpy.testing._private.utils import requires_memory
class TextIO(BytesIO):
@@ -575,13 +576,9 @@ class TestSaveTxt(object):
@pytest.mark.skipif(sys.platform=='win32',
reason="large files cause problems")
@pytest.mark.slow
+ @requires_memory(7e9)
def test_large_zip(self):
# The test takes at least 6GB of memory, writes a file larger than 4GB
- try:
- a = 'a' * 6 * 1024 * 1024 * 1024
- del a
- except (MemoryError, OverflowError):
- pytest.skip("Cannot allocate enough memory for test")
test_data = np.asarray([np.random.rand(np.random.randint(50,100),4)
for i in range(800000)])
with tempdir() as tmpdir: