The most common FastAPI testing setup I see in the wild: the test suite starts the full server with uvicorn , runs requests against localhost:8000 , and tears down at the end. It works. It's also unnecessary. FastAPI ships with a TestClient that runs your app in-process — no server, no ports, no network. Once you understand how it works, you write faster tests and catch a class of dependency-injection bugs that the full-server approach misses. TestClient: what it actually does TestClient wraps httpx.Client around your FastAPI app. When you call client.get("/endpoint") , it routes the request through FastAPI's routing machinery without any network I/O. The request goes in as an ASGI request dict; the response comes back as an httpx.Response . from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI () @app.get ( " /health " ) def health (): return { " status " : " ok " } client = TestClient ( app ) def test_health (): response = client . get ( " /health " ) assert response .…