In our use, it is important to run the tested app in the same event loop as the testing fixtures.
(Basically we preinitialise stuff for the app and that happens in the event loop supplied by pytest. Then we need to keep everything on this loop so that cleanup works correctly. We have run into issues when doing this with redis or database connections).
Replacing the blocking portal with asyncio.create_task fixes the issues for us.
Making the blocking portal optional could be the solution that works for everyone.
Here is a patch that does that:
optional.blocking.portal.patch
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too