Skip to content

fixtures: fix --fixtures-per-test crash on fixture-using doctest - #15055

Open
bluetech wants to merge 1 commit into
pytest-dev:mainfrom
bluetech:showfixtures-doctest-crash
Open

bluetech wants to merge 1 commit into
pytest-dev:mainfrom
bluetech:showfixtures-doctest-crash

Conversation

@bluetech

Copy link
Copy Markdown
Member

Fix #15051

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 17, 2026

@kilisamemarisaaa kilisamemarisaaa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I independently reproduced the reported crash on Windows and re-ran the exact MRE against this head.

Environment: Windows (win32), Python 3.12.6, pytest main 6a0de9be baseline. An autouse fixture plus test_doctest.txt makes --fixtures-per-test raise AttributeError: DoctestItem has no attribute function and exit 0. On head f648fa2e, the same command reports (test_doctest.txt:1), lists auto_fixture, and exits 0; the focused upstream regression file passes (10 passed). The ordinary doctest passes on both baseline and head.

The reportinfo()-based location is appropriate for both function and doctest items, and this does not change the successful command's exit status. Approving based on this Windows verification.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fixtures: --fixtures-per-test crashes on fixture-using doctest

2 participants