Skip to content

chore: Add more RQ integration tests #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 28, 2025
Merged
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
23 changes: 23 additions & 0 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,26 @@ async def test_something(

assert actor_run.status == 'SUCCEEDED'
```

### Asserts

Since test Actors are not executed as standard pytest tests, we don't get introspection of assertion expressions. In case of failure, only a bare `AssertionError` is shown, without the left and right values. This means, we must include explicit assertion messages to aid potential debugging.

```python
async def test_add_and_fetch_requests(
make_actor: MakeActorFunction,
run_actor: RunActorFunction,
) -> None:
"""Test basic functionality of adding and fetching requests."""

async def main() -> None:
async with Actor:
rq = await Actor.open_request_queue()
await rq.add_request(f'https://apify.com/')
assert is_finished is False, f'is_finished={is_finished}'

actor = await make_actor(label='rq-test', main_func=main)
run_result = await run_actor(actor)

assert run_result.status == 'SUCCEEDED'
```
Loading