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

Add test case for changed lined numbers in use-walrus-if #336

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

drdavella
Copy link
Member

Overview

Add (failing) test case for computed line numbers in use-walrus-if

Details

  • We need to make an update so that these change positions are computed properly

@drdavella
Copy link
Member Author

Bumped the unit test timeout since we keep hitting on this for the Python 3.12 tests. See #338.

@drdavella drdavella enabled auto-merge March 6, 2024 21:27
Copy link
Contributor

@andrecsilva andrecsilva left a comment

Choose a reason for hiding this comment

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

I'm not sure what is the problem here. The current behavior seems to be correct as it reports the node positions of the ifs in the original code.

@@ -181,3 +181,35 @@ def func(y):
print("whatever", y)
"""
self.run_and_assert(tmpdir, input_code, expected_output)

@pytest.mark.xfail(reason="Need to recompute line numbers to reflect removed lines")
def test_multiple_warlus_changes(self, tmpdir):
Copy link
Contributor

Choose a reason for hiding this comment

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

warlus -> walrus

@drdavella
Copy link
Member Author

@andrecsilva the line locations here affect the position of the comments in CodeTF. In general we frame our comments in terms of the fix rather than the problem and we want the comments to appear on the right side of the split diff, which means they need to be associated with new code positions.

Copy link

sonarcloud bot commented Mar 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@drdavella drdavella added this pull request to the merge queue Mar 8, 2024
Merged via the queue into main with commit 576f621 Mar 8, 2024
11 checks passed
@drdavella drdavella deleted the add-walrus-test-case branch March 8, 2024 15:33
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