Skip to content

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

Merged
drdavella merged 2 commits into
mainfrom
add-walrus-test-case
Mar 8, 2024
Merged

drdavella merged 2 commits into
mainfrom
add-walrus-test-case

Conversation

@drdavella

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor 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

@andrecsilva andrecsilva left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread tests/codemods/test_walrus_if.py Outdated
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
Copy Markdown
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
Copy Markdown
Contributor 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.

@drdavella
drdavella force-pushed the add-walrus-test-case branch from 7f2ae59 to d6ac755 Compare March 8, 2024 14:48
@drdavella
drdavella requested a review from andrecsilva March 8, 2024 14:48
@sonarqubecloud

sonarqubecloud Bot commented Mar 8, 2024

Copy link
Copy Markdown

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
@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