code: def test_raises_match(self) -> None:
      msg = r"with base \d+"
      with pytest.raises(ValueError, match=msg):
          int("asdf")
  
      msg = "with base 10"
      with pytest.raises(ValueError, match=msg):
          int("asdf")
  
      msg = "with base 16"
      expr = (
          "Regex pattern did not match.\n"
          f" Regex: {msg!r}\n"
          " Input: \"invalid literal for int() with base 10: 'asdf'\""
      )
      with pytest.raises(
          AssertionError, match="(?m)" + re.escape(expr)
      ):
          with pytest.raises(ValueError, match=msg):
              int("asdf", base=10)
  
      # "match" without context manager.
      pytest.raises(ValueError, int, "asdf").match("invalid literal")
      with pytest.raises(AssertionError) as excinfo:
          pytest.raises(ValueError, int, "asdf").match(msg)
      assert str(excinfo.value) == expr
  
      pytest.raises(TypeError, int, match="invalid")
  
      def tfunc(match):
          raise ValueError(f"match={match}")
  
      pytest.raises(ValueError, tfunc, match="asdf").match("match=asdf")
      pytest.raises(ValueError, tfunc, match="").match("match=")
  
imports: import re
  import sys
  import pytest
  from _pytest.outcomes import Failed
  from _pytest.pytester import Pytester
label_desc: Use image node_id 17 for calling the TestRaises obj's underlying member method code with example usage: obj.test_raises_match() without return types