code: def test_several_messages(self) -> None:
      # different messages, b/c Python suppresses multiple identical warnings
      pytest.warns(
          RuntimeWarning, lambda: warnings.warn("w1", RuntimeWarning)
      )
      with pytest.warns(RuntimeWarning):
          with pytest.raises(pytest.fail.Exception):
              pytest.warns(
                  UserWarning,
                  lambda: warnings.warn("w2", RuntimeWarning),
              )
      pytest.warns(
          RuntimeWarning, lambda: warnings.warn("w3", RuntimeWarning)
      )
  
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 2 for calling the TestWarns obj's underlying member method code with example usage: obj.test_several_messages() without return types