Coverage for tests / test_tutorial / test_testing / test_tutorial001.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from inline_snapshot import snapshot 1abcd

2 

3from docs_src.app_testing.tutorial001_py310 import client, test_read_main 1abcd

4 

5 

6def test_main(): 1abcd

7 test_read_main() 1hij

8 

9 

10def test_openapi_schema(): 1abcd

11 response = client.get("/openapi.json") 1efg

12 assert response.status_code == 200, response.text 1efg

13 assert response.json() == snapshot( 1efg

14 { 

15 "openapi": "3.1.0", 

16 "info": {"title": "FastAPI", "version": "0.1.0"}, 

17 "paths": { 

18 "/": { 

19 "get": { 

20 "responses": { 

21 "200": { 

22 "description": "Successful Response", 

23 "content": {"application/json": {"schema": {}}}, 

24 } 

25 }, 

26 "summary": "Read Main", 

27 "operationId": "read_main__get", 

28 } 

29 } 

30 }, 

31 } 

32 )