tests/test_tutorial/test_response_model/test_tutorial003_04.py
raw| 1 | import importlib |
| 2 | |
| 3 | import pytest |
| 4 | from fastapi.exceptions import FastAPIError |
| 5 | |
| 6 | from ...utils import needs_py310 |
| 7 | |
| 8 | |
| 9 | @pytest.mark.parametrize( |
| 10 | "module_name", |
| 11 | [ |
| 12 | pytest.param("tutorial003_04_py310", marks=needs_py310), |
| 13 | ], |
| 14 | ) |
| 15 | def test_invalid_response_model(module_name: str) -> None: |
| 16 | with pytest.raises(FastAPIError): |
| 17 | importlib.import_module(f"docs_src.response_model.{module_name}") |