From 2385e1fcc2ed752969f5307b5d0a180076ecaaa8 Mon Sep 17 00:00:00 2001 From: Akifumi Imanishi Date: Fri, 24 Jan 2025 11:29:30 +0000 Subject: [PATCH] Ignore DeprecationWarning in test for cupyx.scipy.linalg.kron --- .../scipy_tests/linalg_tests/test_special_matrices.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/cupyx_tests/scipy_tests/linalg_tests/test_special_matrices.py b/tests/cupyx_tests/scipy_tests/linalg_tests/test_special_matrices.py index c1aea2e7085..9ba8764a164 100644 --- a/tests/cupyx_tests/scipy_tests/linalg_tests/test_special_matrices.py +++ b/tests/cupyx_tests/scipy_tests/linalg_tests/test_special_matrices.py @@ -1,4 +1,5 @@ import unittest +import warnings from cupy import testing import cupyx.scipy.linalg # NOQA @@ -63,7 +64,13 @@ class TestSpecialMatrices(TestSpecialMatricesBase): accept_error=ValueError) def test_special_matrix(self, xp, scp): function = getattr(scp.linalg, self.function) - return function(*[self._get_arg(xp, arg) for arg in self.args]) + + if self.function == "kron": + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', category=DeprecationWarning) + return function(*[self._get_arg(xp, arg) for arg in self.args]) + else: + return function(*[self._get_arg(xp, arg) for arg in self.args]) @testing.parameterize(*(