Skip to content

Instantly share code, notes, and snippets.

@Goldziher
Created January 3, 2022 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Goldziher/086b980e6b959374666987cc6c9c4d9c to your computer and use it in GitHub Desktop.
Save Goldziher/086b980e6b959374666987cc6c9c4d9c to your computer and use it in GitHub Desktop.
Example starlite test
from starlette.status import HTTP_200_OK
from starlite import create_test_client
from my_app.main import health_check
def test_health_check():
with create_test_client(route_handlers=[health_check]) as client:
response = client.get("/health-check")
assert response.status_code == HTTP_200_OK
assert response.text == "healthy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment