summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2022-11-15 20:26:32 +0100
committerGitHub <noreply@github.com>2022-11-15 20:26:32 +0100
commita7abbeec3f1f974c249a7aa6802debebead0b385 (patch)
treeb0e4fb653fc15ee5ebe3d580b6a43dd6d045075e /numpy/lib
parent8fff8ce75941483040d2fad4b00939abc82b5b2c (diff)
parent9a9a4c6563ad98550ee9a123cef2db95c8315e00 (diff)
downloadnumpy-a7abbeec3f1f974c249a7aa6802debebead0b385.tar.gz
Merge pull request #21895 from hoodmane/emscripten-ci
ENH, CI: Add Emscripten to CI
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/tests/test_format.py5
-rw-r--r--numpy/lib/tests/test_function_base.py3
-rw-r--r--numpy/lib/tests/test_io.py4
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: