From 9cc86f9f74d51cb19c2032702890fa92ecc6ec1e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 11:17:55 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_openapi_form_alias.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/tests/test_openapi_form_alias.py b/tests/test_openapi_form_alias.py index bda32d360..c045c2abc 100644 --- a/tests/test_openapi_form_alias.py +++ b/tests/test_openapi_form_alias.py @@ -1,7 +1,6 @@ from typing import Annotated import pytest - from fastapi import FastAPI, Form from fastapi.testclient import TestClient @@ -21,26 +20,17 @@ def route_with_form_annotated(form_param: Annotated[str, Form(alias="aliased-fie client = TestClient(app) -@pytest.mark.parametrize( - "path", - ["/old-style", "/annotated"] -) +@pytest.mark.parametrize("path", ["/old-style", "/annotated"]) def test_get_route(path: str): response = client.post(path, data={"aliased-field": "Hello, World!"}) assert response.status_code == 200, response.text assert response.json() == {} -@pytest.mark.parametrize( - "schema_obj", - ["Body_annotated", "Body_old_style"] -) +@pytest.mark.parametrize("schema_obj", ["Body_annotated", "Body_old_style"]) def test_form_alias_is_correct(schema_obj: str): response = client.get("/openapi.json") assert response.status_code == 200, response.text print(response.json()["components"]["schemas"]) - form_properties = ( - response.json() - ["components"]["schemas"][schema_obj]["properties"] - ) + form_properties = response.json()["components"]["schemas"][schema_obj]["properties"] assert "aliased-field" in form_properties