diff options
author | mattip <matti.picus@gmail.com> | 2018-11-20 11:13:01 -0800 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-05-23 07:17:26 +0300 |
commit | 113560b576c57fcbaa758cb8e7b12b7f19f51c2f (patch) | |
tree | 6847da59fe339f202f6aafe134a333824867233f /numpy/lib/tests | |
parent | 9b89cfd2f0364151cc6a23806b2b03bc09e16035 (diff) | |
download | numpy-113560b576c57fcbaa758cb8e7b12b7f19f51c2f.tar.gz |
ENH: always use zip64, upgrade pickle protocol to 3
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_io.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index c6193d79f..0151b5118 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -504,8 +504,6 @@ class TestSaveTxt(object): b' (3.142e+00-2.718e+00j) (3.142e+00-2.718e+00j)\n']) - - def test_custom_writer(self): class CustomWriter(list): @@ -574,6 +572,20 @@ class TestSaveTxt(object): else: assert_equal(s.read(), b"%f\n" % 1.) + @pytest.mark.skipif(sys.platform=='win32', + reason="large files cause problems") + @pytest.mark.slow + 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: + np.savez(os.path.join(tmpdir, 'test.npz'), test_data=test_data) class LoadTxtBase(object): def check_compressed(self, fopen, suffixes): @@ -2378,7 +2390,7 @@ class TestPathUsage(object): np.savez(path, lab='place holder') with np.load(path) as data: assert_array_equal(data['lab'], 'place holder') - + def test_savez_compressed_load(self): # Test that pathlib.Path instances can be used with savez. with temppath(suffix='.npz') as path: |