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}