From c4962791e2580e41b6a32238e36b78c6a3546ca4 Mon Sep 17 00:00:00 2001 From: Ilya Konstantinov Date: Fri, 13 Jan 2023 10:14:26 -0500 Subject: [PATCH] make linters happier --- testing/typing_checks.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testing/typing_checks.py b/testing/typing_checks.py index ce68ee3e4a5..71d56d64e33 100644 --- a/testing/typing_checks.py +++ b/testing/typing_checks.py @@ -4,10 +4,10 @@ none of the code triggers any mypy errors. """ import contextlib -from typing import assert_type from typing import Optional import pytest +from typing_extensions import assert_type # Issue #7488. @@ -28,8 +28,7 @@ def check_parametrize_ids_callable(func) -> None: pass -def check_raises_is_a_context_manager() -> None: - a: bool - with pytest.raises(RuntimeError) if a else contextlib.nullcontext() as excinfo: +def check_raises_is_a_context_manager(val: bool) -> None: + with pytest.raises(RuntimeError) if val else contextlib.nullcontext() as excinfo: pass assert_type(excinfo, Optional[pytest.ExceptionInfo[RuntimeError]])