pre-commit-ci-lite[bot]
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
3 deletions
-
tests/test_ast_inference.py
|
|
|
@ -446,13 +446,14 @@ def test_infer_response_model_create_model_error(): |
|
|
|
func() |
|
|
|
from fastapi.utils import PYDANTIC_V2 |
|
|
|
|
|
|
|
target = "pydantic.create_model" if PYDANTIC_V2 else "fastapi._compat.v1.create_model" |
|
|
|
target = ( |
|
|
|
"pydantic.create_model" if PYDANTIC_V2 else "fastapi._compat.v1.create_model" |
|
|
|
) |
|
|
|
|
|
|
|
with patch(target, side_effect=Exception("Boom")): |
|
|
|
assert infer_response_model_from_ast(func) is None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_contains_response() -> None: |
|
|
|
from fastapi.routing import _contains_response |
|
|
|
|
|
|
|
|