1
1
from pytest import raises
2
2
3
+ from array_api_tests import xp as _xp
3
4
from array_api_tests import _array_module as xp
4
5
from array_api_tests import pytest_helpers as ph
5
6
@@ -16,10 +17,12 @@ def test_assert_dtype():
16
17
def test_assert_array_elements ():
17
18
ph .assert_array_elements ("int zeros" , out = xp .asarray (0 ), expected = xp .asarray (0 ))
18
19
ph .assert_array_elements ("pos zeros" , out = xp .asarray (0.0 ), expected = xp .asarray (0.0 ))
19
- with raises (AssertionError ):
20
- ph .assert_array_elements ("mixed sign zeros" , out = xp .asarray (0.0 ), expected = xp .asarray (- 0.0 ))
21
- with raises (AssertionError ):
22
- ph .assert_array_elements ("mixed sign zeros" , out = xp .asarray (- 0.0 ), expected = xp .asarray (0.0 ))
20
+ ph .assert_array_elements ("neg zeros" , out = xp .asarray (- 0.0 ), expected = xp .asarray (- 0.0 ))
21
+ if hasattr (_xp , "signbit" ):
22
+ with raises (AssertionError ):
23
+ ph .assert_array_elements ("mixed sign zeros" , out = xp .asarray (0.0 ), expected = xp .asarray (- 0.0 ))
24
+ with raises (AssertionError ):
25
+ ph .assert_array_elements ("mixed sign zeros" , out = xp .asarray (- 0.0 ), expected = xp .asarray (0.0 ))
23
26
24
27
ph .assert_array_elements ("nans" , out = xp .asarray (float ("nan" )), expected = xp .asarray (float ("nan" )))
25
28
with raises (AssertionError ):
0 commit comments