From 25500442ddb25474a9cce5ef1b43b9e8dcc4b31b Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 6 Mar 2026 09:31:34 +0100 Subject: [PATCH] fix: correct isinstance check in webhook integration test The `_get_finished_run_id` helper was checking `isinstance(run, ListOfRuns)` after calling `.call()`, which returns a `Run` object, not `ListOfRuns`. This caused flaky failures whenever no prior successful runs existed. Co-Authored-By: Claude Opus 4.6 --- tests/integration/test_webhook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_webhook.py b/tests/integration/test_webhook.py index 7d26fd4f..b5fae924 100644 --- a/tests/integration/test_webhook.py +++ b/tests/integration/test_webhook.py @@ -14,6 +14,7 @@ ListOfRuns, ListOfWebhookDispatches, ListOfWebhooks, + Run, Webhook, WebhookDispatch, WebhookEventType, @@ -39,7 +40,7 @@ async def _get_finished_run_id(client: ApifyClient | ApifyClientAsync) -> str: # No completed runs found - start one and wait for it to finish run = await maybe_await(client.actor(HELLO_WORLD_ACTOR).call()) - assert isinstance(run, ListOfRuns) + assert isinstance(run, Run) return run.id