Skip to content

Commit

Permalink
make linters happier
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Jan 13, 2023
1 parent 875db8c commit c496279
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testing/typing_checks.py
Expand Up @@ -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.
Expand All @@ -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]])

0 comments on commit c496279

Please sign in to comment.