Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/array-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
numpy-version: ['1.26', '2.3', 'dev']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
numpy-version: ['1.26', '2.3.5', 'dev']
exclude:
- python-version: '3.10'
numpy-version: '2.3'
numpy-version: '2.3.5'
- python-version: '3.10'
numpy-version: 'dev'
- python-version: '3.13'
numpy-version: '1.26'
- python-version: '3.14'
numpy-version: '1.26'
fail-fast: false
steps:
- name: Checkout array-api-strict
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
numpy-version: ['1.26', '2.3', 'dev']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
numpy-version: ['1.26', '2.3.5', 'dev']
exclude:
- python-version: '3.10'
numpy-version: '2.3'
numpy-version: '2.3.5'
- python-version: '3.10'
numpy-version: 'dev'
- python-version: '3.13'
numpy-version: '1.26'
- python-version: '3.14'
numpy-version: '1.26'
fail-fast: false
steps:
- uses: actions/checkout@v6
Expand All @@ -26,9 +28,10 @@ jobs:
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
else
python -m pip install 'numpy>=1.26,<2.0';
python -m pip install 'numpy=='${{ matrix.numpy-version }}
fi
python -m pip install -r requirements-dev.txt
python -m pip install pytest hypothesis
python -c'import numpy as np; print(f"{np.__version__ = }")'
- name: Run Tests
run: |
pytest
Expand Down
11 changes: 7 additions & 4 deletions array_api_strict/tests/test_array_object.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import sys
import warnings
import operator
from builtins import all as all_

from numpy.testing import assert_raises, suppress_warnings
from numpy.testing import assert_raises
import numpy as np
import pytest

Expand Down Expand Up @@ -269,10 +270,12 @@ def _check_op_array_scalar(dtypes, a, s, func, func_name, BIG_INT=BIG_INT):

else:
# Only test for no error
with suppress_warnings() as sup:
with warnings.catch_warnings():
# ignore warnings from pow(BIG_INT)
sup.filter(RuntimeWarning,
"invalid value encountered in power")
warnings.filterwarnings(
"ignore", category=RuntimeWarning,
message="invalid value encountered in power"
)
func(s)
return True

Expand Down
11 changes: 7 additions & 4 deletions array_api_strict/tests/test_elementwise_functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import warnings
from inspect import signature, getmodule

import numpy as np
import pytest
from numpy.testing import suppress_warnings


from .. import asarray, _elementwise_functions
Expand Down Expand Up @@ -300,10 +300,13 @@ def _array_vals():
if allowed:
conv_scalar = a._promote_scalar(s)

with suppress_warnings() as sup:
with warnings.catch_warnings():
# ignore warnings from pow(BIG_INT)
sup.filter(RuntimeWarning,
"invalid value encountered in power")
warnings.filterwarnings(
"ignore", category=RuntimeWarning,
message="invalid value encountered in power"
)

assert func(s, a) == func(conv_scalar, a)
assert func(a, s) == func(a, conv_scalar)

Expand Down
Loading