Skip to content
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

Use last previous assignment for comprehension-escape #2131

Merged
merged 1 commit into from
May 22, 2018
Merged

Use last previous assignment for comprehension-escape #2131

merged 1 commit into from
May 22, 2018

Conversation

asottile
Copy link
Contributor

Resolves #2130

@asottile
Copy link
Contributor Author

I tried very hard to write a test for

[x for x in range(3)]
[x for x in range(3)]

but I could not get my test to fail :/

Here's what I had:

+        node = astroid.extract_node('''
+        [i for i in range(3)]
+        [i for i in range(3)]
+        ''')
+        with self.assertNoMessages():
+            self.walk(node)

but it was passing :'(

either way, my patch seems to fix that one as well (#2106)

@coveralls
Copy link

coveralls commented May 21, 2018

Coverage Status

Coverage increased (+0.002%) to 89.989% when pulling 9bc2f51 on asottile:newly_introduced_assign into 15c10e8 on PyCQA:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 89.989% when pulling 9bc2f51 on asottile:newly_introduced_assign into 15c10e8 on PyCQA:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 89.989% when pulling 9bc2f51 on asottile:newly_introduced_assign into 15c10e8 on PyCQA:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 89.989% when pulling 9bc2f51 on asottile:newly_introduced_assign into 15c10e8 on PyCQA:master.

Copy link
Contributor

@PCManticore PCManticore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix @asottile !

@PCManticore PCManticore merged commit 092c6e8 into pylint-dev:master May 22, 2018
@asottile asottile deleted the newly_introduced_assign branch May 22, 2018 14:01
sushobhit27 pushed a commit to sushobhit27/pylint that referenced this pull request Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants