def test_raises_match_wrong_type(self):
        """Raising an exception with the wrong type and match= given.

        pytest should throw the unexpected exception - the pattern match is not
        really relevant if we got a different exception.
        """
        with pytest.raises(
            ValueError,
            match=wrap_escape("invalid literal for int() with base 10: 'asdf'"),
        ):
            with pytest.raises(IndexError, match="nomatch"):
                int("asdf")
Raising an exception with the wrong type and match= given.

        pytest should throw the unexpected exception - the pattern match is not
        really relevant if we got a different exception.
        
testing/python/raises.py