Skip to content

Commit 6127c00

Browse files
committed
Use an XFAILs file on CI
This requires data-apis/array-api-tests#157 to work.
1 parent 96226cb commit 6127c00

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

.github/workflows/array-api-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ jobs:
3232
- name: Run the array API testsuite (NumPy)
3333
env:
3434
ARRAY_API_TESTS_MODULE: array_api_compat.numpy
35+
# This enables the NEP 50 type promotion behavior (without it a lot of
36+
# tests fail on bad scalar type promotion behavior)
3537
NPY_PROMOTION_STATE: weak
3638
run: |
3739
export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
3840
cd ${GITHUB_WORKSPACE}/array-api-tests
39-
pytest -v -rxXfE
41+
pytest -v -rxXfE --ci -o xfail_strict=True --xfails-file ${GITHUB_WORKSPACE}/array-api-compat/numpy-xfails.txt

numpy-xfails.txt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# asarray(copy=False) is not yet implemented
2+
array_api_tests/test_creation_functions.py::test_asarray_arrays
3+
4+
# finfo(float32).eps returns float32 but should return float
5+
array_api_tests/test_data_type_functions.py::test_finfo[float32]
6+
7+
# Array methods and attributes not already on np.ndarray cannot be wrapped
8+
array_api_tests/test_has_names.py::test_has_names[array_method-__array_namespace__]
9+
array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
10+
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
11+
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]
12+
13+
# linalg tests require https://github.com/data-apis/array-api-tests/pull/101
14+
# cleanups. Also some tests are using .mT
15+
array_api_tests/test_linalg.py::test_eigvalsh
16+
array_api_tests/test_linalg.py::test_solve
17+
array_api_tests/test_linalg.py::test_trace
18+
19+
# Array methods and attributes not already on np.ndarray cannot be wrapped
20+
array_api_tests/test_signatures.py::test_array_method_signature[__array_namespace__]
21+
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
22+
23+
# NumPy deviates in some special cases for floordiv
24+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
25+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
26+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
27+
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
28+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
29+
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
30+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
31+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
32+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
33+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
34+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
35+
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
36+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
37+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
38+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
39+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
40+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
41+
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
42+
43+
# https://github.com/numpy/numpy/issues/21213
44+
array_api_tests/test_special_cases.py::test_binary[__pow__(x1_i is -infinity and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +infinity]
45+
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -infinity and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +infinity]
46+
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -0 and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +0]
47+
array_api_tests/meta/test_hypothesis_helpers.py::test_symmetric_matrices

0 commit comments

Comments
 (0)