8000 TST: Added script to enforce usage of match argument for tm.assert_produces_warning by chaarvii · Pull Request #59173 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

TST: Added script to enforce usage of match argument for tm.assert_produces_warning #59173

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

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typo
  • Loading branch information
chaarvii committed Jul 2, 2024
commit 2562c7927211df11b56b60aef0a83e74fbe89dfa
6 changes: 3 additions & 3 deletions scripts/enforce_match_arg_in_assert_produces_warning.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""

Enforce that all usages of tms.assert_produces_warning use
Enforce that all usages of tm.assert_produces_warning use
the "match" argument. This will help ensure that users always see
the correct warning message.

tms.assert_produces_warning(None) is excluded as no warning is
tm.assert_produces_warning(None) is excluded as no warning is
produced.

"""
Expand Down Expand Up @@ -32,7 +32,7 @@ def visit_Call(self, node) -> None:
# only check for attribute function of class/module tm
if ( isinstance(node.func.value, ast.Name) and
node.func.value.id == "tm" ):
# ignore tms.assert_produces_warning(None)/tms.assert_produces_warning()
# ignore tm.assert_produces_warning(None)/tm.assert_produces_warning()
if ( len(node.args) == 0 or
(isinstance(node.args[0], ast.Constant) and
node.args[0].value is None) ):
Expand Down
Loading
0