chore: use pytest's new strict mode and fix duplicate tests#10847
Merged
radoering merged 1 commit intopython-poetry:mainfrom Apr 18, 2026
Merged
chore: use pytest's new strict mode and fix duplicate tests#10847radoering merged 1 commit intopython-poetry:mainfrom
radoering merged 1 commit intopython-poetry:mainfrom
Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In
test_peeled_tagthe parametrizedtagargument is immediately overwritten (tag = peeled_tag("my-tag")), so the parameter (and newids) are effectively unused; consider either asserting behavior that depends on the input type or removing the parametrize and hard-coding the value to keep the test intention clear.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `test_peeled_tag` the parametrized `tag` argument is immediately overwritten (`tag = peeled_tag("my-tag")`), so the parameter (and new `ids`) are effectively unused; consider either asserting behavior that depends on the input type or removing the parametrize and hard-coding the value to keep the test intention clear.
## Individual Comments
### Comment 1
<location path="tests/vcs/git/test_backend.py" line_range="105" />
<code_context>
[email protected](("tag"), ["my-tag", b"my-tag"])
[email protected]("tag", ["my-tag", b"my-tag"], ids=["str", "bytes"])
def test_peeled_tag(tag: str | bytes) -> None:
tag = peeled_tag("my-tag")
</code_context>
<issue_to_address>
**issue (testing):** Use the parametrized `tag` value inside the test to actually exercise both `str` and `bytes` inputs.
Right now `test_peeled_tag` ignores the parametrized `tag` and always calls `peeled_tag("my-tag")`, so it never exercises the bytes path. Use the parameter in the call, e.g.
```python
@pytest.mark.parametrize("tag", ["my-tag", b"my-tag"], ids=["str", "bytes"])
def test_peeled_tag(tag: str | bytes) -> None:
result = peeled_tag(tag)
assert result == b"my-tag^{}" # or the correct expected value
```
so the parametrization actually validates both input types and protects against regressions in their handling.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
4a20310 to
5d9c7a2
Compare
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.
No description provided.