From b9c3dee6c3b93f4be7dd203ac807e972b13b3364 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 27 Oct 2020 20:16:16 +0100 Subject: [PATCH] fixup! tests: harden testing/test_recwarn.py::TestWarningsRecorderChecker::test_typechecking (regressed in 2dca68) --- testing/test_recwarn.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index ad186fbb7f..e245eff32e 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -53,15 +53,15 @@ def test_warn_stacklevel(self) -> None: def test_typechecking(self) -> None: msg = "exceptions must be derived from Warning, not {}" with pytest.raises(TypeError, match=msg.format("int")): - WarningsChecker(5) + WarningsChecker(5) # type: ignore[arg-type] with pytest.raises(TypeError, match=msg.format("str")): - WarningsChecker(("hi", RuntimeWarning)) + WarningsChecker(("hi", RuntimeWarning)) # type: ignore[arg-type] with pytest.raises(TypeError, match=msg.format("list")): - WarningsChecker([DeprecationWarning, RuntimeWarning]) + WarningsChecker([DeprecationWarning, RuntimeWarning]) # type: ignore[arg-type] def test_nested_tuples(self) -> None: wc1 = WarningsChecker((DeprecationWarning, RuntimeWarning)) - wc2 = WarningsChecker(((DeprecationWarning,), (RuntimeWarning,))) + wc2 = WarningsChecker(((DeprecationWarning,), (RuntimeWarning,))) # type: ignore[arg-type] assert wc1.expected_warning == (DeprecationWarning, RuntimeWarning) assert wc1.expected_warning == wc2.expected_warning