Skip to content

Commit 56fa066

Browse files
committed
.
1 parent b3a7f57 commit 56fa066

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

array_api_strict/tests/test_array_object.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import operator
44
from builtins import all as all_
55

6-
from numpy.testing import assert_raises #, suppress_warnings
6+
from numpy.testing import assert_raises
77
import numpy as np
88
import pytest
99

@@ -271,11 +271,11 @@ def _check_op_array_scalar(dtypes, a, s, func, func_name, BIG_INT=BIG_INT):
271271
else:
272272
# Only test for no error
273273
with warnings.catch_warnings():
274-
# with suppress_warnings() as sup:
275274
# ignore warnings from pow(BIG_INT)
276-
warnings.filterwarnings("ignore", category=RuntimeWarning,
277-
# sup.filter(RuntimeWarning,
278-
message="invalid value encountered in power")
275+
warnings.filterwarnings(
276+
"ignore", category=RuntimeWarning,
277+
message="invalid value encountered in power"
278+
)
279279
func(s)
280280
return True
281281

array_api_strict/tests/test_elementwise_functions.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import numpy as np
44
import pytest
5-
from numpy.testing import suppress_warnings
5+
##from numpy.testing import suppress_warnings
66

77

88
from .. import asarray, _elementwise_functions
@@ -300,10 +300,16 @@ def _array_vals():
300300
if allowed:
301301
conv_scalar = a._promote_scalar(s)
302302

303-
with suppress_warnings() as sup:
303+
with warnings.catch_warnings():
304304
# ignore warnings from pow(BIG_INT)
305-
sup.filter(RuntimeWarning,
306-
"invalid value encountered in power")
305+
warnings.filterwarnings(
306+
"ignore", category=RuntimeWarning,
307+
message="invalid value encountered in power"
308+
)
309+
## with suppress_warnings() as sup:
310+
# ignore warnings from pow(BIG_INT)
311+
## sup.filter(RuntimeWarning,
312+
## "invalid value encountered in power")
307313
assert func(s, a) == func(conv_scalar, a)
308314
assert func(a, s) == func(a, conv_scalar)
309315

0 commit comments

Comments
 (0)