Testing
Test LongLink applications with standard pytest(opens in new tab) and pytest-asyncio(opens in new tab) workflows. Generated projects also include the dependencies needed by longlink.testing.TestClient.
To install the development dependencies, run:
bashpip install .[dev]
Usage
You can execute all tests or target a specific test file using the LongLink test command. Arguments after longlink test are forwarded to pytest.
bashuv run longlink testuv run longlink test tests/test_app.py -q
Example
LongLink applications are FastAPI applications, and longlink.testing.TestClient is a compatible facade over FastAPI's TestClient(opens in new tab). Use async pytest tests for lower-level async services when needed.
pythonfrom main import appfrom longlink.testing import TestClientclient = TestClient(app)def test_healthcheck() -> None:"""Return the LongLink runtime health payload."""response = client.get("/health")assert response.status_code == 200