Skip to content

Commit b7ab914

Browse files
authored
Merge pull request #92 from honno/ci-skips
Skip rather than xfail on CI
2 parents 17e7537 + 8ce3791 commit b7ab914

File tree

4 files changed

+12
-19
lines changed

4 files changed

+12
-19
lines changed

.github/workflows/numpy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
env:
2626
ARRAY_API_TESTS_MODULE: numpy.array_api
2727
run: |
28-
# Mark some known issues as XFAIL
29-
cat << EOF >> xfails.txt
28+
# Skip test cases with known issues
29+
cat << EOF >> skips.txt
3030
3131
# copy not implemented
3232
array_api_tests/test_creation_functions.py::test_asarray_arrays

array_api_tests/test_linalg.py

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def true_diag(x_stack):
229229

230230
_test_stacks(linalg.diagonal, x, **kw, res=res, dims=1, true_val=true_diag)
231231

232+
@pytest.mark.skip(reason="Inputs need to be restricted") # TODO
232233
@pytest.mark.xp_extension('linalg')
233234
@given(x=symmetric_matrices(finite=True))
234235
def test_eigh(x):

array_api_tests/test_statistical_functions.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,7 @@ def test_mean(x, data):
6969
ph.assert_keepdimable_shape(
7070
"mean", out.shape, x.shape, _axes, kw.get("keepdims", False), **kw
7171
)
72-
for indices, out_idx in zip(sh.axes_ndindex(x.shape, _axes), sh.ndindex(out.shape)):
73-
mean = float(out[out_idx])
74-
assume(not math.isinf(mean)) # mean may become inf due to internal overflows
75-
elements = []
76-
for idx in indices:
77-
s = float(x[idx])
78-
elements.append(s)
79-
expected = sum(elements) / len(elements)
80-
ph.assert_scalar_equals("mean", float, out_idx, mean, expected)
72+
# Values testing mean is too finicky
8173

8274

8375
@given(

conftest.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def xp_has_ext(ext: str) -> bool:
7171
return False
7272

7373

74-
xfail_ids = []
75-
xfails_path = Path(__file__).parent / "xfails.txt"
76-
if xfails_path.exists():
77-
with open(xfails_path) as f:
74+
skip_ids = []
75+
skips_path = Path(__file__).parent / "skips.txt"
76+
if skips_path.exists():
77+
with open(skips_path) as f:
7878
for line in f:
7979
if line.startswith("array_api_tests"):
8080
id_ = line.strip("\n")
81-
xfail_ids.append(id_)
81+
skip_ids.append(id_)
8282

8383

8484
def pytest_collection_modifyitems(config, items):
@@ -96,10 +96,10 @@ def pytest_collection_modifyitems(config, items):
9696
)
9797
elif not xp_has_ext(ext):
9898
item.add_marker(mark.skip(reason=f"{ext} not found in array module"))
99-
# xfail if specified in xfails.txt
100-
for id_ in xfail_ids:
99+
# skip if specified in skips.txt
100+
for id_ in skip_ids:
101101
if item.nodeid.startswith(id_):
102-
item.add_marker(mark.xfail(reason="xfails.txt"))
102+
item.add_marker(mark.skip(reason="skips.txt"))
103103
break
104104
# skip if test not appropiate for CI
105105
if ci:

0 commit comments

Comments
 (0)