pytest-asyncio provides one asyncio event loop for each pytest collector (Session, Package, Module, Class, or Function).
By default, tests run in the event loop provided by the Function collector, which offers the highest level of isolation. However, you can configure tests to share an event loop from a common ancestor collector by passing the loop_scope keyword argument to the @pytest.mark.asyncio marker.
Best Practice: It is highly recommended that neighboring tests (e.g., all tests within the same class or module) use the same event loop scope to keep the test code easy to follow.