Coverage for tests / test_return_none_stringified_annotations.py: 100%

12 statements  

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

1import http 1defg

2 

3from fastapi import FastAPI 1defg

4from fastapi.testclient import TestClient 1defg

5 

6 

7def test_no_content(): 1defg

8 app = FastAPI() 1abc

9 

10 @app.get("/no-content", status_code=http.HTTPStatus.NO_CONTENT) 1abc

11 def return_no_content() -> "None": 1abc

12 return 1abc

13 

14 client = TestClient(app) 1abc

15 response = client.get("/no-content") 1abc

16 assert response.status_code == http.HTTPStatus.NO_CONTENT, response.text 1abc

17 assert not response.content 1abc