Avoid PytestAssertRewriteWarning in tests using runpytest#1508
Avoid PytestAssertRewriteWarning in tests using runpytest#1508pctablet505 wants to merge 2 commits into
Conversation
Adds --assert=plain to inner runpytest calls for tests that check warning counts, and removes redundant pytest_plugins declarations in generated test code. Keeps in-process execution so the pytest-dev#1227 FreeBSD fix remains effective. Fixes pytest-dev#1334
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1508 +/- ##
=======================================
Coverage 94.50% 94.50%
=======================================
Files 2 2
Lines 510 510
Branches 62 62
=======================================
Hits 482 482
Misses 22 22
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
seifertm
left a comment
There was a problem hiding this comment.
Thanks for the initiative.
The code changes do make sense superficially, but I'm reluctant to integrate them when there's no proof the patch actually solves the problem. Personally, I also don't understand the nature of what causes the issue. In order to progress this, I think we need to find answers to one or more of the following questions:
What is the reason assertion rewriting or setting pytest_plugins causes problems in the first place?
Can you provide a reproducer that verifies this patch fixes the linked GUIX issue?
Can you provide a reproducer that verifies for FreeBSD that this patch does not regress #1227 ?
Fixes #1334
Pass
--assert=plainto the in-processrunpytestcalls for the six tests that emitPytestAssertRewriteWarning, keeping the #1227 in-process fix intact. Also drop the explicitpytest_pluginsassignment in the two event-loop fixture tests so they do not mark the already-loaded plugin for assertion rewriting.