Python: Add jump-to-def tests for unpacking assignments#20303
Merged
hvitved merged 1 commit intogithub:mainfrom Aug 28, 2025
Merged
Python: Add jump-to-def tests for unpacking assignments#20303hvitved merged 1 commit intogithub:mainfrom
hvitved merged 1 commit intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds test cases for jump-to-definition functionality in Python unpacking assignments to document currently missing jump-to-def targets. The changes identify specific scenarios where variable references should have jump-to-definition support but currently don't.
- Adds test cases with unpacking assignments (
head, tail = os.path.split(dirname)) and loop unpacking (for start, line in enumerate(lines)) - Documents missing jump-to-def targets with inline comments
- Updates expected test results to reflect current behavior for existing working jump-to-def cases
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/ql/test/query-tests/analysis/jump_to_defn/test.py | Adds new test function with unpacking assignments and comments documenting missing jump-to-def targets |
| python/ql/test/query-tests/analysis/jump_to_defn/Definitions.expected | Updates expected test results with working jump-to-def cases for function parameters and variable assignments |
tausbn
approved these changes
Aug 28, 2025
Contributor
tausbn
left a comment
There was a problem hiding this comment.
This feels like something that ought to use inline test expectations (but I'm not going to insist on it). 🙂
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Document missing jump-to-def targets.