Skip to content

Commit 3bec9bb

Browse files
committed
Revert changes to see status of the tests on MacOS
1 parent e4e52ba commit 3bec9bb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/unit/events/test_local_event_manager.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
from datetime import timedelta
5+
from functools import update_wrapper
56
from typing import Any
67
from unittest.mock import AsyncMock
78

@@ -16,15 +17,15 @@ def listener() -> AsyncMock:
1617
async def async_listener(payload: Any) -> None:
1718
pass
1819

19-
return AsyncMock(target=async_listener)
20+
al = AsyncMock()
21+
update_wrapper(al, async_listener)
22+
return al
2023

2124

2225
async def test_emit_system_info_event(listener: AsyncMock) -> None:
23-
system_info_interval = timedelta(milliseconds=50)
24-
test_tolerance_coefficient = 10
25-
async with LocalEventManager(system_info_interval=system_info_interval) as event_manager:
26+
async with LocalEventManager(system_info_interval=timedelta(milliseconds=50)) as event_manager:
2627
event_manager.on(event=Event.SYSTEM_INFO, listener=listener)
27-
await asyncio.sleep(system_info_interval.total_seconds() * test_tolerance_coefficient)
28+
await asyncio.sleep(0.2)
2829

2930
assert listener.call_count >= 1
3031
assert isinstance(listener.call_args[0][0], EventSystemInfoData)

0 commit comments

Comments
 (0)