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

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-04 08:29 +0000

1import pytest 1abcdefg

2from httpx import ASGITransport, AsyncClient 1abcdefg

3 

4from .main import app 1abcdefg

5 

6 

7@pytest.mark.anyio 1abcdefg

8async def test_root(): 1abcdefg

9 async with AsyncClient( 1hijklmnopqrstu

10 transport=ASGITransport(app=app), base_url="http://test" 

11 ) as ac: 

12 response = await ac.get("/") 1hijklmnopqrstu

13 assert response.status_code == 200 1hijklmnopqrstu

14 assert response.json() == {"message": "Tomato"} 1hijklmnopqrstu