Skip to content

Commit cf6cf07

Browse files
committed
Update tests to support latest time-machine
And migrate to latest time-machine version v2.16.0 Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 286ad18 commit cf6cf07

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ dev-pytest = [
8484
"frequenz-repo-config[extra-lint-examples] == 0.13.3",
8585
"pytest-mock == 3.14.0",
8686
"pytest-asyncio == 0.26.0",
87-
"time-machine == 2.12.0",
87+
"time-machine == 2.16.0",
8888
"async-solipsism == 0.7",
8989
"hypothesis == 6.131.9",
9090
]

tests/microgrid/power_distributing/_component_status/test_battery_status.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from datetime import datetime, timedelta, timezone
1313
from typing import Generic, TypeVar
1414

15+
import async_solipsism
1516
import pytest
1617
from frequenz.channels import Broadcast, Receiver
1718
from frequenz.client.microgrid import (
@@ -42,6 +43,12 @@
4243
from ....utils.receive_timeout import Timeout, receive_timeout
4344

4445

46+
@pytest.fixture
47+
def event_loop_policy() -> async_solipsism.EventLoopPolicy:
48+
"""Event loop policy."""
49+
return async_solipsism.EventLoopPolicy()
50+
51+
4552
def battery_data( # pylint: disable=too-many-arguments,too-many-positional-arguments
4653
component_id: ComponentId,
4754
timestamp: datetime | None = None,

0 commit comments

Comments
 (0)