Replies: 1 comment
-
This would quite likely require coloring much of the internals As such its currently not feasible to consider as a endgame It's however a topic that may be interesting for the sprint to consider But until pluggy is more async aware it's unlikely There's some experiment's for integration of asyncio and greenlets Currently I suspect that greenlets are the most workable tools to drive this, this is to be taken with salt |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Curious about high-level thoughts/approaches to a situation.
We're using pytest to run a test suite against an application that leverages an event loop that's sometimes provided by the platform; this loop is hooked in to
asyncio
to allow a similar API for interacting with them across platforms.For testing, we are shunting
pytest.main()
in to a thread; this thread is started as part of the application's start up process once the event loop is started in the main thread. From there, the tests can run using the application's event loop with some magic frompytest-asyncio
.This creates at least two problems for us:
I did find
alt-pytest-asyncio
....but it appears to try runningpytest.main()
in a loop nested within the already running loop.asyncio
as well as the other event loops we're using don't support nested loops.So, we're thinking...what if we could add
pytest.main()
as a coroutine to the event loop? Superficially, at least, this seems far from trivial right now....given pytest doesn't seem to support anything like that.But I was curious if anyone's come across this or thought about a similar situation before. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions