File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,8 @@ def test_array_namespace():
410
410
assert a .__array_namespace__ (api_version = "2022.12" ) is array_api_strict
411
411
assert array_api_strict .__array_api_version__ == "2022.12"
412
412
413
- assert a .__array_namespace__ (api_version = "2023.12" ) is array_api_strict
413
+ with pytest .warns (UserWarning ):
414
+ assert a .__array_namespace__ (api_version = "2023.12" ) is array_api_strict
414
415
assert array_api_strict .__array_api_version__ == "2023.12"
415
416
416
417
with pytest .warns (UserWarning ):
Original file line number Diff line number Diff line change 12
12
)
13
13
from .._flags import set_array_api_strict_flags
14
14
15
+ import pytest
16
+
15
17
def nargs (func ):
16
18
return len (getfullargspec (func ).args )
17
19
@@ -101,7 +103,8 @@ def _array_vals():
101
103
yield asarray (1.0 , dtype = d )
102
104
103
105
# Use the latest version of the standard so all functions are included
104
- set_array_api_strict_flags (api_version = "2023.12" )
106
+ with pytest .warns (UserWarning ):
107
+ set_array_api_strict_flags (api_version = "2023.12" )
105
108
106
109
for x in _array_vals ():
107
110
for func_name , types in elementwise_function_input_types .items ():
Original file line number Diff line number Diff line change @@ -73,9 +73,10 @@ def test_flags():
73
73
set_array_api_strict_flags (api_version = '2020.12' ))
74
74
pytest .raises (ValueError , lambda : set_array_api_strict_flags (
75
75
enabled_extensions = ('linalg' , 'fft' , 'invalid' )))
76
- pytest .raises (ValueError , lambda : set_array_api_strict_flags (
77
- api_version = '2021.12' ,
78
- enabled_extensions = ('linalg' , 'fft' )))
76
+ with pytest .warns (UserWarning ):
77
+ pytest .raises (ValueError , lambda : set_array_api_strict_flags (
78
+ api_version = '2021.12' ,
79
+ enabled_extensions = ('linalg' , 'fft' )))
79
80
80
81
# Test resetting flags
81
82
with pytest .warns (UserWarning ):
@@ -96,7 +97,8 @@ def test_api_version():
96
97
assert xp .__array_api_version__ == '2022.12'
97
98
98
99
# Test setting the version
99
- set_array_api_strict_flags (api_version = '2021.12' )
100
+ with pytest .warns (UserWarning ):
101
+ set_array_api_strict_flags (api_version = '2021.12' )
100
102
assert xp .__array_api_version__ == '2021.12'
101
103
102
104
def test_data_dependent_shapes ():
You can’t perform that action at this time.
0 commit comments