Skip to content

Commit 7063a5c

Browse files
committed
WIP: suppress_warnings
1 parent 2dab4c1 commit 7063a5c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

array_api_strict/tests/test_array_object.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import sys
2+
import warnings
23
import operator
34
from builtins import all as all_
45

5-
from numpy.testing import assert_raises, suppress_warnings
6+
from numpy.testing import assert_raises #, suppress_warnings
67
import numpy as np
78
import pytest
89

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

270271
else:
271272
# Only test for no error
272-
with suppress_warnings() as sup:
273+
with warnings.catch_warnings():
274+
# with suppress_warnings() as sup:
273275
# ignore warnings from pow(BIG_INT)
274-
sup.filter(RuntimeWarning,
275-
"invalid value encountered in power")
276+
warnings.simplefilter("ignore", category=RuntimeWarning,
277+
# sup.filter(RuntimeWarning,
278+
message="invalid value encountered in power")
276279
func(s)
277280
return True
278281

0 commit comments

Comments
 (0)