From eda9b28338c79bfd28f008507fe92599ec2ea815 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Sat, 23 Mar 2019 13:10:45 +0300 Subject: [PATCH] files formatting --- fastapi/routing.py | 8 +++++--- tests/test_additional_responses.py | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 2f53e0b08..9dfd316ab 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -148,9 +148,11 @@ class APIRoute(routing.Route): existed_codes.append(add_response.status_code) response_models: List[Any] = [m for m in add_response.models] schema_field = None - if add_response.content_type == "application/json" or lenient_issubclass( - content_type, JSONResponse - ) and len(response_models): + if ( + add_response.content_type == "application/json" + or lenient_issubclass(content_type, JSONResponse) + and len(response_models) + ): schema_field = Field( name=f"Additional_response_{add_response.status_code}", type_=Union[tuple(response_models)], diff --git a/tests/test_additional_responses.py b/tests/test_additional_responses.py index aa150b538..fa46d3ccb 100644 --- a/tests/test_additional_responses.py +++ b/tests/test_additional_responses.py @@ -2,7 +2,6 @@ import pytest from fastapi import FastAPI from fastapi.openapi.models import AdditionalResponse from pydantic import BaseModel -from pydantic.error_wrappers import ValidationError from starlette.responses import JSONResponse from starlette.testclient import TestClient