code: def test_catch_warning_within_raise(self) -> None:
      # warns-in-raises works since https://github.com/pytest-dev/pytest/pull/11129
      with pytest.raises(ValueError, match="some exception"):
          with pytest.warns(FutureWarning, match="some warning"):
              warnings.warn("some warning", category=FutureWarning)
              raise ValueError("some exception")
      # and raises-in-warns has always worked but we'll check for symmetry.
      with pytest.warns(FutureWarning, match="some warning"):
          with pytest.raises(ValueError, match="some exception"):
              warnings.warn("some warning", category=FutureWarning)
              raise ValueError("some exception")
  
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 21 for calling the TestWarns obj's underlying member method code with example usage: obj.test_catch_warning_within_raise() without return types