-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
Cache ancestors #1120
Cache ancestors #1120
Changes from all commits
bd3f55e
066ad3f
b12ca11
d102dda
ff31cd0
826ce5b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1040,7 +1040,7 @@ class Past(Present): | |||||
astroid = builder.parse(data) | ||||||
past = astroid["Past"] | ||||||
attr = past.getattr("attr") | ||||||
self.assertEqual(len(attr), 1) | ||||||
self.assertEqual(len(attr), 1, attr) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think when using pytest this is possible (?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any Ideas why this might have started failing though? I had a read through There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on
with my changes this becomes...
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I was looking at the wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect that using |
||||||
attr1 = attr[0] | ||||||
self.assertIsInstance(attr1, nodes.AssignName) | ||||||
self.assertEqual(attr1.name, "attr") | ||||||
|
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.
I think this is necessary for Python 3.6 to preserve the order of yielded ancestors: a plain
dict
achieves the same thing from Python 3.7+