Skip to content

Avoid PytestAssertRewriteWarning in tests using runpytest#1508

Draft
pctablet505 wants to merge 1 commit into
pytest-dev:mainfrom
pctablet505:fix-1334-assert-rewrite-warning
Draft

Avoid PytestAssertRewriteWarning in tests using runpytest#1508
pctablet505 wants to merge 1 commit into
pytest-dev:mainfrom
pctablet505:fix-1334-assert-rewrite-warning

Conversation

@pctablet505

@pctablet505 pctablet505 commented Jul 15, 2026

Copy link
Copy Markdown

Fixes #1334

Pass --assert=plain to the in-process runpytest calls for the six tests that emit PytestAssertRewriteWarning, keeping the #1227 in-process fix intact. Also drop the explicit pytest_plugins assignment in the two event-loop fixture tests so they do not mark the already-loaded plugin for assertion rewriting.

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

PytestAssertRewriteWarning due to runpytest and pytest_plugins

1 participant