diff options
author | Hood Chatham <roberthoodchatham@gmail.com> | 2022-11-10 11:54:21 -0800 |
---|---|---|
committer | Hood Chatham <roberthoodchatham@gmail.com> | 2022-11-11 02:52:06 -0800 |
commit | 08c6e9c142e619ac5175b6a13342ba2f2c571ddd (patch) | |
tree | 8be92e0f2d27dd9c888fde95c2dfe46a305ba892 /numpy/lib | |
parent | 6aacc5167983d7c6f8689d7039294f2fc0d5f5fb (diff) | |
download | numpy-08c6e9c142e619ac5175b6a13342ba2f2c571ddd.tar.gz |
TST: Skip tests that are not currently supported in wasm
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/tests/test_format.py | 5 | ||||
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 3 | ||||
-rw-r--r-- | numpy/lib/tests/test_io.py | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index 08878a1f9..ab9472020 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -283,7 +283,7 @@ from io import BytesIO import numpy as np from numpy.testing import ( assert_, assert_array_equal, assert_raises, assert_raises_regex, - assert_warns, IS_PYPY, + assert_warns, IS_PYPY, IS_WASM ) from numpy.testing._private.utils import requires_memory from numpy.lib import format @@ -459,6 +459,7 @@ def test_long_str(): assert_array_equal(long_str_arr, long_str_arr2) +@pytest.mark.skipif(IS_WASM, reason="memmap doesn't work correctly") @pytest.mark.slow def test_memmap_roundtrip(tmpdir): for i, arr in enumerate(basic_arrays + record_arrays): @@ -526,6 +527,7 @@ def test_load_padded_dtype(tmpdir, dt): assert_array_equal(arr, arr1) +@pytest.mark.xfail(IS_WASM, reason="Emscripten NODEFS has a buggy dup") def test_python2_python3_interoperability(): fname = 'win64python2.npy' path = os.path.join(os.path.dirname(__file__), 'data', fname) @@ -675,6 +677,7 @@ def test_version_2_0(): assert_raises(ValueError, format.write_array, f, d, (1, 0)) +@pytest.mark.skipif(IS_WASM, reason="memmap doesn't work correctly") def test_version_2_0_memmap(tmpdir): # requires more than 2 byte for header dt = [(("%d" % i) * 100, float) for i in range(500)] diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 88d4987e6..c5b31ebf4 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -15,7 +15,7 @@ from numpy import ma from numpy.testing import ( assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose, IS_PYPY, - assert_warns, assert_raises_regex, suppress_warnings, HAS_REFCOUNT, + assert_warns, assert_raises_regex, suppress_warnings, HAS_REFCOUNT, IS_WASM ) import numpy.lib.function_base as nfb from numpy.random import rand @@ -3754,6 +3754,7 @@ class TestMedian: b[2] = np.nan assert_equal(np.median(a, (0, 2)), b) + @pytest.mark.skipif(IS_WASM, reason="fp errors don't work correctly") def test_empty(self): # mean(empty array) emits two warnings: empty slice and divide by 0 a = np.array([], dtype=float) diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index a5462749f..4699935ca 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -25,7 +25,7 @@ from numpy.testing import ( assert_warns, assert_, assert_raises_regex, assert_raises, assert_allclose, assert_array_equal, temppath, tempdir, IS_PYPY, HAS_REFCOUNT, suppress_warnings, assert_no_gc_cycles, assert_no_warnings, - break_cycles + break_cycles, IS_WASM ) from numpy.testing._private.utils import requires_memory @@ -243,6 +243,7 @@ class TestSavezLoad(RoundtripTest): assert_equal(a, l.f.file_a) assert_equal(b, l.f.file_b) + @pytest.mark.skipif(IS_WASM, reason="Cannot start thread") def test_savez_filename_clashes(self): # Test that issue #852 is fixed # and savez functions in multithreaded environment @@ -2539,6 +2540,7 @@ class TestPathUsage: break_cycles() break_cycles() + @pytest.mark.xfail(IS_WASM, reason="memmap doesn't work correctly") def test_save_load_memmap_readwrite(self): # Test that pathlib.Path instances can be written mem-mapped. with temppath(suffix='.npy') as path: |