Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/run_code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org'}}
with:
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'

docs_check:
name: Docs check
Expand Down
11 changes: 5 additions & 6 deletions tests/unit/events/test_local_event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import asyncio
from datetime import timedelta
from functools import update_wrapper
from typing import Any
from unittest.mock import AsyncMock

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

al = AsyncMock()
update_wrapper(al, async_listener)
return al
return AsyncMock(target=async_listener)


async def test_emit_system_info_event(listener: AsyncMock) -> None:
async with LocalEventManager(system_info_interval=timedelta(milliseconds=50)) as event_manager:
system_info_interval = timedelta(milliseconds=50)
test_tolerance_coefficient = 10
async with LocalEventManager(system_info_interval=system_info_interval) as event_manager:
event_manager.on(event=Event.SYSTEM_INFO, listener=listener)
await asyncio.sleep(0.2)
await asyncio.sleep(system_info_interval.total_seconds() * test_tolerance_coefficient)

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