File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ disable = [
165165[tool .pytest .ini_options ]
166166testpaths = [" tests" , " src" ]
167167asyncio_mode = " auto"
168+ asyncio_default_fixture_loop_scope = " function"
168169required_plugins = [" pytest-asyncio" , " pytest-mock" ]
169170
170171[tool .mypy ]
Original file line number Diff line number Diff line change 99from typing import AsyncIterator , Iterator
1010
1111import async_solipsism
12- import pytest
1312import time_machine
1413from frequenz .channels import Broadcast , Receiver , Sender
1514from frequenz .client .dispatch .test .generator import DispatchGenerator
2019from frequenz .dispatch import Dispatch , DispatchManagingActor , DispatchUpdate
2120
2221
23- # This method replaces the event loop for all tests in the file.
24- @pytest .fixture
22+ @fixture
2523def event_loop_policy () -> async_solipsism .EventLoopPolicy :
26- """Return an event loop policy that uses the async solipsism event loop."""
27- return async_solipsism .EventLoopPolicy ()
24+ """Set the event loop policy to use async_solipsism."""
25+ policy = async_solipsism .EventLoopPolicy ()
26+ asyncio .set_event_loop_policy (policy )
27+ return policy
2828
2929
3030@fixture
You can’t perform that action at this time.
0 commit comments