Skip to content

Commit df64786

Browse files
committed
Remove use of numpy.testing.suppress_warnings
1 parent e2c0469 commit df64786

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dpnp/tests/conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ def allow_fall_back_on_numpy(monkeypatch):
183183

184184
@pytest.fixture
185185
def suppress_complex_warning():
186-
sup = numpy.testing.suppress_warnings("always")
187-
sup.filter(ComplexWarning)
188-
with sup:
186+
with warnings.catch_warnings():
187+
warnings.simplefilter("ignore", ComplexWarning)
189188
yield
190189

191190

dpnp/tests/test_linalg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import warnings
2+
13
import dpctl
24
import dpctl.tensor as dpt
35
import numpy
@@ -10,7 +12,6 @@
1012
assert_equal,
1113
assert_raises,
1214
assert_raises_regex,
13-
suppress_warnings,
1415
)
1516

1617
import dpnp
@@ -847,8 +848,8 @@ def check_einsum_sums(self, dtype, do_opt=False):
847848
)
848849

849850
# Suppress the complex warnings for the 'as f8' tests
850-
with suppress_warnings() as sup:
851-
sup.filter(numpy.exceptions.ComplexWarning)
851+
with warnings.catch_warnings():
852+
warnings.simplefilter("ignore", numpy.exceptions.ComplexWarning)
852853

853854
# matvec(a,b) / a.dot(b) where a is matrix, b is vector
854855
for n in range(1, 17):

0 commit comments

Comments
 (0)