-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
Closed
Labels
EnhancementNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team memberTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suite
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.
Metadata
Metadata
Assignees
Labels
EnhancementNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team memberTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suite