You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our tests currently ensure that warnings are triggered whenever appropriate, but to ensure end users get a correct and meaningful warning message, we should also make sure the correct warning message is surfaced whenever we check for a warning.
And so I propose we start enforcing the usage of the match argument in all uses of tm.assert_produces_warning.
Using the regex assert_produces_warning\([a-zA-Z]*\), I was able to find around 200 bare uses of assert_produces_warning, and some of them are checking that warnings are not raised, so this will be an easy task to finish and would be a good way for new contributors to get familiar with the pandas codebase.
If all agree, then we can open a new issue which would have instructions for how to find the bare uses, and maybe we can enforce this using our linter. We could also implement a method tm.external_warning_produced similiar to tm.external_error_raised, which would be equivalent to using tm.assert_produces_warning(warning, match=None)
Our tests currently ensure that warnings are triggered whenever appropriate, but to ensure end users get a correct and meaningful warning message, we should also make sure the correct warning message is surfaced whenever we check for a warning.
And so I propose we start enforcing the usage of the
match
argument in all uses oftm.assert_produces_warning
.Using the regex
assert_produces_warning\([a-zA-Z]*\)
, I was able to find around 200 bare uses ofassert_produces_warning
, and some of them are checking that warnings are not raised, so this will be an easy task to finish and would be a good way for new contributors to get familiar with the pandas codebase.If all agree, then we can open a new issue which would have instructions for how to find the bare uses, and maybe we can enforce this using our linter. We could also implement a method
tm.external_warning_produced
similiar totm.external_error_raised
, which would be equivalent to usingtm.assert_produces_warning(warning, match=None)
See also #23922, #30999 and #37261.
The text was updated successfully, but these errors were encountered: