File tree Expand file tree Collapse file tree 5 files changed +8
-28
lines changed
Expand file tree Collapse file tree 5 files changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -35,13 +35,6 @@ def event_loop() -> Iterator[async_solipsism.EventLoop]:
3535 loop .close ()
3636
3737
38- @pytest .fixture
39- def fake_time () -> Iterator [time_machine .Coordinates ]:
40- """Replace real time with a time machine that doesn't automatically tick."""
41- with time_machine .travel (0 , tick = False ) as traveller :
42- yield traveller
43-
44-
4538def _now () -> datetime :
4639 return datetime .now (timezone .utc )
4740
Original file line number Diff line number Diff line change @@ -23,13 +23,6 @@ def event_loop() -> Iterator[async_solipsism.EventLoop]:
2323 loop .close ()
2424
2525
26- @pytest .fixture
27- def fake_time () -> Iterator [time_machine .Coordinates ]:
28- """Replace real time with a time machine that doesn't automatically tick."""
29- with time_machine .travel (0 , tick = False ) as traveller :
30- yield traveller
31-
32-
3326class FaultyActor (Actor ):
3427 """A test faulty actor."""
3528
Original file line number Diff line number Diff line change 77from datetime import timedelta
88
99import pytest
10+ import time_machine
1011
1112from frequenz .sdk .actor import _actor
1213
@@ -52,3 +53,10 @@ def actor_auto_restart_once() -> Iterator[None]:
5253 """Make actors restart only once."""
5354 with actor_restart_limit (1 ):
5455 yield
56+
57+
58+ @pytest .fixture
59+ def fake_time () -> Iterator [time_machine .Coordinates ]:
60+ """Replace real time with a time machine that doesn't automatically tick."""
61+ with time_machine .travel (0 , tick = False ) as traveller :
62+ yield traveller
Original file line number Diff line number Diff line change @@ -28,13 +28,6 @@ def event_loop() -> Iterator[async_solipsism.EventLoop]:
2828 loop .close ()
2929
3030
31- @pytest .fixture
32- def fake_time () -> Iterator [time_machine .Coordinates ]:
33- """Replace real time with a time machine that doesn't automatically tick."""
34- with time_machine .travel (0 , tick = False ) as traveller :
35- yield traveller
36-
37-
3831async def push_logical_meter_data (
3932 sender : Sender [Sample [Quantity ]], test_seq : Sequence [float ]
4033) -> None :
Original file line number Diff line number Diff line change @@ -47,13 +47,6 @@ def event_loop() -> Iterator[async_solipsism.EventLoop]:
4747 loop .close ()
4848
4949
50- @pytest .fixture
51- def fake_time () -> Iterator [time_machine .Coordinates ]:
52- """Replace real time with a time machine that doesn't automatically tick."""
53- with time_machine .travel (0 , tick = False ) as traveller :
54- yield traveller
55-
56-
5750@pytest .fixture
5851async def source_chan () -> AsyncIterator [Broadcast [Sample [Quantity ]]]:
5952 """Create a broadcast channel of samples."""
You can’t perform that action at this time.
0 commit comments