code: def test_warns_context_manager_with_kwargs(self) -> None:
      with pytest.raises(TypeError) as excinfo:
          with pytest.warns(UserWarning, foo="bar"):  # type: ignore
              pass
      assert "Unexpected keyword arguments" in str(excinfo.value)
  
imports: import warnings
  from typing import List
  from typing import Optional
  from typing import Type
  import pytest
  from _pytest.pytester import Pytester
  from _pytest.recwarn import WarningsRecorder
label_desc: Use image node_id 15 for calling the TestWarns obj's underlying member method code with example usage: obj.test_warns_context_manager_with_kwargs() without return types