-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
fix bug when rewriting deprecated unittest functions #891
fix bug when rewriting deprecated unittest functions #891
Conversation
isinstance(node.func, ast.Attribute) and | ||
isinstance(node.func.value, ast.Name) and | ||
node.func.value.id == 'unittest' and | ||
node.func.attr in FUNCTION_MAPPING |
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.
don't touch unrelated code to imbue your style on it
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.
oops, left formatter settings on, sorry
('unittest.makeSuite(Tests, "arg")',), | ||
('unittest.makeSuite(Tests, prefix="arg")',), |
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.
these don't have to be 1-tuples -- can just be strings
('unittest.makeSuite(Tests, "arg")'), | ||
('unittest.makeSuite(Tests, prefix="arg")'), |
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.
these parens do nothing
( | ||
pytest.param( | ||
'class ExampleTests:\n' | ||
' def test_something(self):\n' | ||
' self.assertEqual(1, 1)\n', | ||
id='not a deprecated alias', | ||
), | ||
# https://github.com/asottile/pyupgrade/issues/749# |
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.
if this link is important put it in the pytest id -- if it's not remove it -- also it contains a typo
592ad5e
to
7d86735
Compare
the commit message is kinda unclear here -- it probably should be something closer to "prevent rewriting unittest module functions with additional arguments" -- or something like it |
7d86735
to
22d8c6c
Compare
just mistakenly copied an old git command when changing commit message, fixing this |
22d8c6c
to
c98e8ed
Compare
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.
Closes #749.
I saw that #759 was closed without actually fixing the issue.