Skip to content

Commit bb658d1

Browse files
committed
Also freeze_time test_node_discovery_and_load
1 parent 71e6f57 commit bb658d1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/stick_test_data.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
# generate energy log timestamps with fixed hour timestamp used in tests
1616
# 2025-04-03 22:00:00
17-
hour_timestamp = datetime(2025, 4, 3, 22, 0, 0) # utc_now.replace(minute=0, second=0, microsecond=0)
17+
hour_timestamp = datetime(
18+
2025, 4, 3, 22, 0, 0
19+
) # utc_now.replace(minute=0, second=0, microsecond=0)
1820

1921
LOG_TIMESTAMPS = {}
2022
_one_hour = timedelta(hours=1)
@@ -606,7 +608,7 @@
606608
+ bytes(("%%0%dd" % 2) % utc_now.weekday(), pw_constants.UTF8) # noqa: UP031
607609
+ bytes(("%%0%dd" % 2) % utc_now.day, pw_constants.UTF8) # noqa: UP031
608610
+ bytes(("%%0%dd" % 2) % utc_now.month, pw_constants.UTF8) # noqa: UP031
609-
+ bytes(("%%0%dd" % 2) % (utc_now.year - 2000), pw_constants.UTF8) # noqa: UP031
611+
+ bytes(("%%0%dd" % 2) % (utc_now.year - 2000), pw_constants.UTF8), # noqa: UP031
610612
),
611613
b"\x05\x05\x03\x0300280098765432101234000022030304259DDF\r\n": (
612614
"Circle+ Realtime set clock for 0098765432101234",

tests/test_usb.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,6 +2724,7 @@ async def load_callback(event: pw_api.NodeEvent, mac: str) -> None: # type: ign
27242724
)
27252725
assert not state[pw_api.NodeFeature.AVAILABLE].state
27262726

2727+
@freeze_time("2025-04-03 22:00:00", real_asyncio=True)
27272728
@pytest.mark.asyncio
27282729
async def test_node_discovery_and_load( # noqa: PLR0915
27292730
self, monkeypatch: pytest.MonkeyPatch

0 commit comments

Comments
 (0)