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