pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Deduplicate pythonwarnings to fix -W duplication

Open tanuj-rai opened this issue 3 months ago • 2 comments

Here is a quick checklist that should be present in PRs.

  • [ ] Include documentation when adding new features.
  • [ ] Include new tests or update existing tests when applicable.
  • [X] Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.

What this PR does:

This PR adds deduplication step after the second command-line argument parse in _pytest/config/init.py to ensure that --pythonwarnings (-W) values are unique.

closes #13484

Who can review: @bluetech @nicoddemus @RonnyPfannschmidt

tanuj-rai avatar Oct 08 '25 08:10 tanuj-rai

Thanks for the PR @tanuj-rai.

I don't think this is the approach we should go with, because it fixes the symptom instead of the underlying cause. I suspect the real fix will need to dig deeper into our "boot-up" procedure.

bluetech avatar Oct 13 '25 06:10 bluetech

Thanks for the PR @tanuj-rai.

I don't think this is the approach we should go with, because it fixes the symptom instead of the underlying cause. I suspect the real fix will need to dig deeper into our "boot-up" procedure.

Thanks @bluetech for the feedback. I will try to fix it properly.

tanuj-rai avatar Oct 13 '25 16:10 tanuj-rai