fix(tutorials): install pytest-asyncio in async agent images so their tests run - #480
Closed
deepthi-rao-scale wants to merge 1 commit into
Closed
fix(tutorials): install pytest-asyncio in async agent images so their tests run#480deepthi-rao-scale wants to merge 1 commit into
deepthi-rao-scale wants to merge 1 commit into
Conversation
… tests can run The integration suite runs each agent's test_agent.py inside its published image. The async tutorial agents' tests use @pytest.mark.asyncio, but their Dockerfiles installed only .[dev] (which lacks pytest-asyncio), so the tests failed to import with 'ModuleNotFoundError: No module named pytest_asyncio' (exit code 2, all retries). 100_gemini_litellm installed just '.', so it had no test deps at all. Bring all 13 async agents in line with the already-working ones (e.g. 010_agent_chat, 020_state_machine): install '.[dev] pytest-asyncio httpx'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vineetvora-scale
approved these changes
Jul 30, 2026
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.
Problem
The integration suite runs each tutorial agent's
test_agent.pyinside its published image. The async agents' tests use@pytest.mark.asyncio, but their Dockerfiles installed only.[dev]— which does not includepytest-asyncio. So the tests fail to import:100_gemini_litellmwas worse — it installed just.(no dev deps at all).This is why unrelated PRs (e.g.
scale-agentex#385) keep going red on060/070/080/090/110/...— the failure is a missing test dependency in the images, not the PR's code.Fix
Bring the 13 async agents in line with the agents that already work (
010_agent_chat,020_state_machine, etc.), which install.[dev] pytest-asyncio httpx:Sync agents (
00_sync/*) are untouched — their tests are synchronous and pass withoutpytest-asyncio.Effect
Once released and the images are rebuilt, each async agent's
test_agent.pycan import and run, and the10-async-*integration jobs pass.🤖 Generated with Claude Code
Greptile Summary
This PR adds
pytest-asyncioandhttpxto theuv pip installline in 13 async tutorial agent Dockerfiles, matching the pattern already used by working agents. The missing packages were causingModuleNotFoundError: No module named 'pytest_asyncio'when the integration suite ran each agent'stest_agent.pyinside its published image.COPY \u2026 /testsandCOPY test_utilsin its Dockerfile and only needed the install line updated.100_gemini_litellmhad the worst starting state (bare.install) and receives the same install fix, but has notests/directory in the repo and no correspondingCOPYinstructions in its Dockerfile \u2014 so its integration job will still have nothing to run after the image is rebuilt.Confidence Score: 4/5
Safe to merge — the one-line install change is correct and unblocks 12 of the 13 agents; only 100_gemini_litellm remains incomplete.
Twelve agents get a complete fix: they already had their test files copied into the image and just needed pytest-asyncio and httpx added to the install command. The thirteenth, 100_gemini_litellm, has no tests/ directory in the repo at all and no COPY instructions for tests or test_utils in its Dockerfile, so its integration job will still produce no runnable tests after the image is rebuilt.
Files Needing Attention: examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile — needs a tests/ directory created and corresponding COPY instructions added alongside the install fix.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Integration Suite] --> B{Agent Image} B --> C[COPY project/] B --> D[COPY tests/] B --> E[COPY test_utils/] C --> F["uv pip install .[dev] pytest-asyncio httpx"] D --> F E --> F F --> G[pytest runs test_agent.py] G --> H{pytest-asyncio present?} H -- Yes --> I[Tests pass] H -- No --> J[ModuleNotFoundError] subgraph gemini[100_gemini_litellm still incomplete] K[COPY project/] L["uv pip install .[dev] pytest-asyncio httpx"] M[No tests directory or COPY in Dockerfile] end K --> L L --> MComments Outside Diff (1)
examples/tutorials/10_async/10_temporal/100_gemini_litellm/Dockerfile, line 39-43 (link)pytest-asynciois now installed, but there is notestsdirectory in this agent (confirmed: the tree shows onlyproject/,pyproject.toml,README.md, and.dockerignore), and the Dockerfile does notCOPYatestsdirectory ortest_utilsinto the image. Every other agent fixed in this PR has bothCOPY ... /testsandCOPY test_utils /app/test_utilsbefore theRUNline. For100_gemini_litellm, the integration runner will still fail — either "no tests found" or a missing module — because the test files are never placed in the image.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "fix(tutorials): install pytest-asyncio i..." | Re-trigger Greptile