Skip to content

Understand the changes of event-loop when moving from 0.21 #1171

Answered by seifertm
jefflieu asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry, I forgot about this limitation.

The scope is the regular pytest scope that you're familiar with. I'll refer to it as caching scope. The loop_scope refers to the scope of the asyncio event loop. In other words, the loop scope decides when the event loop is reset.

The loop scope can only be the same or a larger scope than the caching scope. It's impossible to cache the result of test_fixture for the whole test package (as specified by scope="package"), if the loop is reset for every function (as specified by loop_scope="function").

As a consequence, you either need to widen the loop scope of your fixture and test to package or you need to narrow the caching scope to function.

We shou…

Replies: 6 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@seifertm
Comment options

Comment options

You must be logged in to vote
2 replies
@seifertm
Comment options

@jefflieu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@seifertm
Comment options

Answer selected by jefflieu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants