Coverage for docs_src/async_tests/test_main.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1import pytest 1abcde

2from httpx import AsyncClient 1abcde

3 

4from .main import app 1abcde

5 

6 

7@pytest.mark.anyio 1abcde

8async def test_root(): 1abcde

9 async with AsyncClient(app=app, base_url="http://test") as ac: 1abcde

10 response = await ac.get("/") 1abcde

11 assert response.status_code == 200 1abcde

12 assert response.json() == {"message": "Tomato"} 1abcde