Coverage for tests / test_tutorial / test_response_model / test_tutorial003_04.py: 100%

8 statements  

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

1import importlib 1abcd

2 

3import pytest 1abcd

4from fastapi.exceptions import FastAPIError 1abcd

5 

6from ...utils import needs_py310 1abcd

7 

8 

9@pytest.mark.parametrize( 1abcd

10 "module_name", 

11 [ 

12 pytest.param("tutorial003_04_py310", marks=needs_py310), 

13 ], 

14) 

15def test_invalid_response_model(module_name: str) -> None: 1abcd

16 with pytest.raises(FastAPIError): 1efg

17 importlib.import_module(f"docs_src.response_model.{module_name}") 1efg