8.1 One more tool for the tests, after the run image
Build it yourself. Read the tutorial is the other way to read this part.
This walk goes through rahuldave/cheesecracker on GitHub. This part starts from the code at step-07. The code before this part
This part does not start where the part before it ends, because the walk skips some changes. This command puts the files that this part starts from in place of yours. Run it, and then go on:
git fetch --quiet --tags --force origin; git restore --source 0acb4556f724 --staged -- :/ && git restore --source step-07 --staged --worktree -- :/If you start at this part, make your clone as Get the project says, and then run this command. It puts in your clone the files that this part starts from. A file that the project deleted before this part stays, so delete it if git check lists it:
git fetch --quiet --tags --force origin; git rm -rq --cached --ignore-unmatch -- :/ && git restore --source step-07 --staged --worktree -- :/just setupThe whole tutorial then adds recipes for Docker. The system tests send real HTTP requests, with the package requests.
requests goes into the group test, and the run image never sees it.
8.1 requests, for tests that send real HTTP requests
The system tests send their requests with the package requests, the most used
HTTP library of Python. It is a tool of the tests, so it goes into the group
test.
uv add --group test requestsuv run python -c "import requests; print(requests.__version__)"Python prints the version of requests.
Check your files against this move. The command prints nothing when they match, and otherwise shows what differs:
git check de0780b72a5cIf you are stuck, this command puts the files of this move in place of yours. A file that you made yourself stays:
git fetch --quiet --tags --force origin; git restore --source step-07 --staged -- :/ && git restore --source de0780b72a5c --staged --worktree -- :/What changed
pyproject.toml: requests, in the grouptest. 1 line added. It comes fromuv add --group test requests. The file- look at
"requests>=2.34.2",
- look at
uv.lock: the exact versions of requests, and of the packages that it needs. 166 lines added. It comes fromuv add --group test requests. The file
The diff that uv add --group test requests makes in pyproject.toml
@@ -25,6 +25,7 @@ test = [
"pytest>=9.1.1",
"pytest-asyncio>=1.4.0",
"pytest-cov>=7.1.0",
+ "requests>=2.34.2",
]
[tool.pytest.ini_options]This part ends at the code at de0780b72a5c, partway through step-08. The code after this part