diff --git a/CHANGELOG.md b/CHANGELOG.md index fe489e21b50..8f4326a256c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Bumped oneMKL version up to `v0.8` [#2514](https://github.com/IntelPython/dpnp/pull/2514) * Removed the use of class template argument deduction for alias template to conform to the C++17 standard [#2517](https://github.com/IntelPython/dpnp/pull/2517) * Changed th order of individual FFTs over `axes` for `dpnp.fft.irfftn` to be in forward order [#2524](https://github.com/IntelPython/dpnp/pull/2524) +* Replaced the use of `numpy.testing.suppress_warnings` with appropriate calls from the warnings module [#2529](https://github.com/IntelPython/dpnp/pull/2529) ### Deprecated diff --git a/dpnp/tests/conftest.py b/dpnp/tests/conftest.py index 7544949f1bd..a0a76e3edb4 100644 --- a/dpnp/tests/conftest.py +++ b/dpnp/tests/conftest.py @@ -183,9 +183,8 @@ def allow_fall_back_on_numpy(monkeypatch): @pytest.fixture def suppress_complex_warning(): - sup = numpy.testing.suppress_warnings("always") - sup.filter(ComplexWarning) - with sup: + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ComplexWarning) yield diff --git a/dpnp/tests/test_linalg.py b/dpnp/tests/test_linalg.py index 19943b6fcd6..931c631b563 100644 --- a/dpnp/tests/test_linalg.py +++ b/dpnp/tests/test_linalg.py @@ -1,3 +1,5 @@ +import warnings + import dpctl import dpctl.tensor as dpt import numpy @@ -10,7 +12,6 @@ assert_equal, assert_raises, assert_raises_regex, - suppress_warnings, ) import dpnp @@ -847,8 +848,8 @@ def check_einsum_sums(self, dtype, do_opt=False): ) # Suppress the complex warnings for the 'as f8' tests - with suppress_warnings() as sup: - sup.filter(numpy.exceptions.ComplexWarning) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", numpy.exceptions.ComplexWarning) # matvec(a,b) / a.dot(b) where a is matrix, b is vector for n in range(1, 17):