From 806965144161be97b1dc73975881aaf401ead611 Mon Sep 17 00:00:00 2001 From: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:20:55 +0200 Subject: [PATCH] Simplify the code of test --- tests/test_endpoint_with_async_class_decorator.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/test_endpoint_with_async_class_decorator.py b/tests/test_endpoint_with_async_class_decorator.py index d8ac561d5..c75823b18 100644 --- a/tests/test_endpoint_with_async_class_decorator.py +++ b/tests/test_endpoint_with_async_class_decorator.py @@ -13,20 +13,14 @@ class SomeDecorator: return await self.route(*args, **kwargs) -data = {"working": True} - - +@app.get("/") @SomeDecorator -async def route(): - return data - - -app = FastAPI() -app.get("/")(route) +async def route1(): + return {"working": True} client = TestClient(app) def test_endpoint_with_async_class_decorator(): response = client.get("/") - assert data == response.json() + assert response.json() == {"working": True}