pytest-dev / pytest-dev/pytest

plugin registration for assert rewrite for pytest_plugins is done one at a time at import time

Open
#2,353 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: rewrite type: bug
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

when registering a set of plugins that import from each other, this behavior is incorrect and leads to transient errors

as a workaround i had to put pytest.register_assert_rewrite(*pytest_plugins) after the declaration

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing pytest's plugin registration and pytest_plugins import handling. Reproduce the issue with a set of plugins that import from each other, then compare registration during import with the documented workaround. Done means mutually importing plugins register without transient errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.