We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7f1a16 commit 03ee1b1Copy full SHA for 03ee1b1
pytest_asyncio/plugin.py
@@ -494,7 +494,7 @@ def pytest_runtest_setup(item: pytest.Item) -> None:
494
@pytest.fixture
495
def event_loop(request: "pytest.FixtureRequest") -> Iterator[asyncio.AbstractEventLoop]:
496
"""Create an instance of the default event loop for each test case."""
497
- return asyncio.get_event_loop_policy().new_event_loop()
+ yield asyncio.get_event_loop_policy().new_event_loop()
498
# Call the garbage collector to trigger ResourceWarning's as soon
499
# as possible (these are triggered in various __del__ methods).
500
# Without this, resources opened in one test can fail other tests
0 commit comments