-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: Added script to enforce usage of match argument for tm.assert_produces_warning #59173
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Co-authored-by: Abdulaziz Aloqeely <[email protected]>
@Aloqeely Just fixed the issue with |
LGTM. cc @mroeschke |
@mroeschke - are we going ahead with this PR? Any reason we’d like to hold it off for now? cc @Aloqeely |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Added a script called
enforce_match_arg_in_assert_produces_warning.py
which checks that all usages of tm.assert_produces_warning make use of thematch
argument. This is done to ensure that users are always displayed the correct warning message. Uses oftm.assert_produces_warning(None)
have been excluded as no warning is produced in this case.Furthermore, to ensure that the existing code doesn't fail the
pre-commit
stage, all files that currently do not use the match argument have been excluded.Once the PR is merged in, we can open up another issue to shorten the list of "excluded" files.