code: def test_expected_exception_is_not_a_baseexception(self) -> None:
      with pytest.raises(TypeError) as excinfo:
          with pytest.raises("hello"):  # type: ignore[call-overload]
              pass  # pragma: no cover
      assert "must be a BaseException type, not str" in str(
          excinfo.value
      )
  
      class NotAnException:
          pass
  
      with pytest.raises(TypeError) as excinfo:
          with pytest.raises(NotAnException):  # type: ignore[type-var]
              pass  # pragma: no cover
      assert "must be a BaseException type, not NotAnException" in str(
          excinfo.value
      )
  
      with pytest.raises(TypeError) as excinfo:
          with pytest.raises(("hello", NotAnException)):  # type: ignore[arg-type]
              pass  # pragma: no cover
      assert "must be a BaseException type, not str" in str(
          excinfo.value
      )
  
imports: import re
  import sys
  import pytest
  from _pytest.outcomes import Failed
  from _pytest.pytester import Pytester
label_desc: Use image node_id 24 for calling the TestRaises obj's underlying member method code with example usage: obj.test_expected_exception_is_not_a_baseexception() without return types