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

Fix AssertionError when inferring a property consisting of a partial function #2458

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

jacobtylerwalls
Copy link
Member

Type of Changes

Type
🐛 Bug fix

Description

Closes pylint-dev/pylint#9214

Thanks Martin Belanger for the report and Bryce Guinta for the test case.

@brycepg would you like to review?

…function.

Closes pylint-dev/pylint#9214

Thanks Martin Belanger for the report and
Bryce Guinta for the test case.
@@ -2518,6 +2518,10 @@ def igetattr(
elif isinstance(inferred, objects.Property):
function = inferred.function
if not class_context:
if not context.callcontext:
Copy link
Member Author

Choose a reason for hiding this comment

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

We may have the identical problem just below this, but I'm hesitant to just add it without a test case in hand. One thing at a time :-)

Copy link

codecov bot commented Jul 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.74%. Comparing base (314e08b) to head (91bb78c).
Report is 141 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2458   +/-   ##
=======================================
  Coverage   92.74%   92.74%           
=======================================
  Files          94       94           
  Lines       10993    10995    +2     
=======================================
+ Hits        10195    10197    +2     
  Misses        798      798           
Flag Coverage Δ
linux 92.62% <100.00%> (+<0.01%) ⬆️
pypy 92.74% <100.00%> (+<0.01%) ⬆️
windows 92.72% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
astroid/nodes/scoped_nodes/scoped_nodes.py 92.79% <100.00%> (+0.01%) ⬆️

@jacobtylerwalls jacobtylerwalls merged commit 0f9dfa6 into main Jul 8, 2024
20 checks passed
@jacobtylerwalls jacobtylerwalls deleted the failed-callcontext-assertion branch July 8, 2024 12:51
github-actions bot pushed a commit that referenced this pull request Jul 8, 2024
…function. (#2458)

Closes pylint-dev/pylint#9214

Thanks Martin Belanger for the report and
Bryce Guinta for the test case.

(cherry picked from commit 0f9dfa6)
jacobtylerwalls added a commit that referenced this pull request Jul 9, 2024
…function. (#2458)

Closes pylint-dev/pylint#9214

Thanks Martin Belanger for the report and
Bryce Guinta for the test case.

(cherry picked from commit 0f9dfa6)
jacobtylerwalls added a commit that referenced this pull request Jul 9, 2024
…function. (#2458) (#2460)

Closes pylint-dev/pylint#9214

Thanks Martin Belanger for the report and
Bryce Guinta for the test case.

(cherry picked from commit 0f9dfa6)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
@brycepg
Copy link
Contributor

brycepg commented Jul 9, 2024

Nice! deceptively straightforward :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Assigned once the backport is done Crash 💥
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CallContext assertion failed in the wild
3 participants