Closed
Description
Is your feature request related to a problem?
I wish we could match warning messages using pandas._testing.assert_produces_warning
.
Currently it catches the warning category, but does not match the message.
Recently (#36982) I stumbled upon the need for this feature.
Describe the solution you'd like
pandas._testing.assert_produces_warning
should take optional keyword argument match
, to make it look similar to pytest.warns
.
API breaking implications
Should not break existing API, as match
would be an optional argument.
Describe alternatives you've considered
I used custom way of catching warnings (via warnings.catch_warnings
) and matching their messages, but was suggested to give preference to assert_produces_warning
.