test: unify polling helpers with apify-sdk-python#837
Draft
vdusek wants to merge 1 commit into
Draft
Conversation
Add generic call_with_exp_backoff and poll_until_condition test helpers, matching the signatures shared with apify-sdk-python and crawlee-python. Both accept sync or async callables (via a small _maybe_await helper, typed with overloads), which fits this repo's sync/async client duality. Rebuild collect_iterate_until_present on top of poll_until_condition: the iterate/drain logic stays, but the polling loop is delegated to the shared helper. The contract is unchanged - the last collected list is returned so callers keep asserting with their own failure messages.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #837 +/- ##
==========================================
- Coverage 94.72% 94.68% -0.04%
==========================================
Files 48 48
Lines 5045 5045
==========================================
- Hits 4779 4777 -2
- Misses 266 268 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds generic
call_with_exp_backoffandpoll_until_conditiontest helpers with signatures shared acrossapify-sdk-python,crawlee-python, andapify-client-python. Both accept sync or async callables (via a small_maybe_awaithelper, typed with overloads), which fits this repo's sync/async client duality.collect_iterate_until_presentis rebuilt on top ofpoll_until_condition: the iterate/drain logic stays, but the polling loop is delegated to the shared helper. The contract is unchanged — the last collected list is returned so callers keep asserting with their own failure messages.Lint, type-check, and test collection pass; integration tests require a platform token and were not run locally.