These tests verify the SDK's internal logic in isolation, without making any real API calls. All external dependencies (Apify API, platform services) are mocked. They are fast and can be run without any environment variables or credentials.
uv run poe unit-testsprepare_test_env/_isolate_test_environment(autouse) — Resets global state (Actor initialization, service locator, storage) and setsAPIFY_LOCAL_STORAGE_DIRto a temporary directory before each test.apify_client_async_patcher— Helper for patchingApifyClientAsyncmethods to return fixed values or replacement functions, with automatic call tracking.httpserver— Local HTTP server (viapytest-httpserver) for testing HTTP interactions without real network calls.
If tests fail with SystemExit: 0 raised from _actor.py when async with Actor: exits, the virtual environment lacks the optional extras. Without Scrapy installed, the Actor exits the process on teardown. Run uv sync --all-extras (or uv run poe install-dev).