Running the tests on a fresh install fails before a single test runs.
Steps:
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
pytest
Result:
RuntimeError: The starlette.testclient module requires the httpx package to be installed.
fastapi.testclient.TestClient needs httpx, and it is not listed in requirements.txt. Installing it by hand makes all 45 tests pass.
Suggested fix: add httpx to the requirements. While at it, pytest currently sits in the same file, so it also ends up in the Docker image. A separate requirements-dev.txt with pytest and httpx would keep the runtime image smaller and make the README test instructions work as written.
Running the tests on a fresh install fails before a single test runs.
Steps:
Result:
fastapi.testclient.TestClientneedshttpx, and it is not listed inrequirements.txt. Installing it by hand makes all 45 tests pass.Suggested fix: add
httpxto the requirements. While at it,pytestcurrently sits in the same file, so it also ends up in the Docker image. A separaterequirements-dev.txtwithpytestandhttpxwould keep the runtime image smaller and make the README test instructions work as written.