File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 11# License: MIT
22# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33
4- """Simple test for the BaseActor."""
4+ """Tests for the asyncio module."""
5+
56import asyncio
6- from collections .abc import Iterator
77from typing import Literal , assert_never
88
99import async_solipsism
1212from frequenz .core .asyncio import BackgroundService
1313
1414
15- # Setting 'autouse' has no effect as this method replaces the event loop for all tests in the file.
16- @pytest .fixture ()
17- def event_loop () -> Iterator [async_solipsism .EventLoop ]:
18- """Replace the loop with one that doesn't interact with the outside world."""
19- loop = async_solipsism .EventLoop ()
20- yield loop
21- loop .close ()
15+ # This method replaces the event loop for all tests in the file.
16+ @pytest .fixture
17+ def event_loop_policy () -> async_solipsism .EventLoopPolicy :
18+ """Return an event loop policy that uses the async solipsism event loop."""
19+ return async_solipsism .EventLoopPolicy ()
2220
2321
2422class FakeService (BackgroundService ):
You can’t perform that action at this time.
0 commit comments