8.1 One more tool for the tests, after the run image

Read the tutorial. Build it yourself 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

To look at this code on your machine, run these commands. The first one makes a clone, if this folder has none:

[ -d cheesecracker ] || git clone https://github.com/rahuldave/cheesecracker
cd cheesecracker
git fetch --quiet --tags --force origin
git switch --detach step-07
just setup

The 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.

This change came from running uv add --group test requests.

uv run python -c "import requests; print(requests.__version__)"

Python prints the version of requests.

What changed

  • pyproject.toml: requests, in the group test. 1 line added. It comes from uv add --group test requests. The file
    • look at "requests>=2.34.2",
  • uv.lock: the exact versions of requests, and of the packages that it needs. 166 lines added. It comes from uv add --group test requests. The file

The diff of 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 change on GitHub

This part ends at the code at de0780b72a5c, partway through step-08. The code after this part