From d88ef23a63c68dc148975c6a5f44b650594500f3 Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Thu, 5 Dec 2024 12:56:07 -0800 Subject: [PATCH] array API: improve test coverage --- .github/workflows/jax-array-api.yml | 4 ++-- tests/array_api_skips.txt | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jax-array-api.yml b/.github/workflows/jax-array-api.yml index 54a2bf469..92fef2cc2 100644 --- a/.github/workflows/jax-array-api.yml +++ b/.github/workflows/jax-array-api.yml @@ -38,11 +38,11 @@ jobs: - name: Install dependencies run: | python -m pip install .[ci] - python -m pip install -r array-api-tests/requirements.txt + python -m pip install pytest-xdist -r array-api-tests/requirements.txt - name: Run the test suite env: ARRAY_API_TESTS_MODULE: jax.numpy JAX_ENABLE_X64: 'true' run: | cd ${GITHUB_WORKSPACE}/array-api-tests - pytest array_api_tests --max-examples=5 --derandomize --disable-deadline --skips-file ${GITHUB_WORKSPACE}/tests/array_api_skips.txt + pytest -n auto array_api_tests --derandomize --disable-deadline --skips-file ${GITHUB_WORKSPACE}/tests/array_api_skips.txt diff --git a/tests/array_api_skips.txt b/tests/array_api_skips.txt index e1d4c35ea..2f8d4d1c6 100644 --- a/tests/array_api_skips.txt +++ b/tests/array_api_skips.txt @@ -13,3 +13,9 @@ array_api_tests/test_special_cases.py::test_unary[sign((x_i is -0 or x_i == +0)) # Returns int32 when int64 is expected array_api_tests/test_searching_functions.py::test_searchsorted + +# clip out dtype has ambiguous semantics (https://github.com/numpy/numpy/issues/24976) +array_api_tests/test_operators_and_elementwise_functions.py::test_clip + +# JAX raises a ValueError rather than the expected IndexError for out-of-bound axis +array_api_tests/test_manipulation_functions.py::test_expand_dims