code: 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]])
  
file_path: pytest/testing/typing_checks.py
imports: import contextlib
  from typing import Optional
  from typing_extensions import assert_type
  import pytest
  from pytest import MonkeyPatch
label_desc: Use image node_id 5 for calling a global function with example usage: check_raises_is_a_context_manager(val) without return types