Skip to content

Mention scoping limitation for event loop fixtures#577

Merged
seifertm merged 3 commits into
pytest-dev:mainfrom
seifertm:improve-event-loop-fixture-scope-docs
Jul 12, 2023
Merged

Mention scoping limitation for event loop fixtures#577
seifertm merged 3 commits into
pytest-dev:mainfrom
seifertm:improve-event-loop-fixture-scope-docs

Conversation

@seifertm

@seifertm seifertm commented Jul 12, 2023

Copy link
Copy Markdown
Contributor

The fixture reference does not mention the fact that the scopes of event_loop fixtures should not overlap. People may run into warnings and errors when they use overlapping scopes. (see #531)

This PR mentions the scoping limitation in the fixtures reference and extends the warning message for unclosed event loops to point users to a potential scoping issue.

Closes #531

seifertm added 3 commits July 12, 2023 10:24
The example for overriding event loop scopes now uses a module scope rather than a session scope. Due to the constraint that event_loop fixture scopes should not overlap, a session-scoped fixture is usually not that helpful.

Addresses pytest-dev#531

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
…nal possible cause.

Closes pytest-dev#531

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
…he docs.

The headings no longer use the "pre-formatted" text style.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm seifertm requested review from Tinche and asvetlov as code owners July 12, 2023 08:33
@seifertm seifertm merged commit df88119 into pytest-dev:main Jul 12, 2023
@seifertm seifertm deleted the improve-event-loop-fixture-scope-docs branch October 23, 2023 06:15
@seifertm seifertm restored the improve-event-loop-fixture-scope-docs branch October 23, 2023 08:17
@seifertm seifertm deleted the improve-event-loop-fixture-scope-docs branch October 23, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant