Skip to content

TST Improve error message of assert_produces_warning #42103

@MarcoGorelli

Description

@MarcoGorelli

Currently, when using assert_produces_warning with match=, the error message is not helpful. e.g.:

E           AssertionError: Did not see warning 'FutureWarning' matching The default value of regex wilt change from True to False in a future version\.$

I think it should show the diff of the message, like pytest does

Metadata

Metadata

Labels

Error ReportingIncorrect or improved errors from pandasTestingpandas testing functions or related to the test suitegood first issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions