Testing

Test your application with standard pytest(opens in new tab) workflows. Use TestClient to run the application with isolated in-memory services, without configuring a separate test environment.

bash
uv run pytest <filename>

Example

python
from main import app
from longlink.testclient import TestClient
​
​
client = TestClient(app)
​
​
def test_healthcheck() -> None:
"""Return the LongLink runtime health payload."""
response = client.get("/health")
​
assert response.status_code == 200