From 6e00c80e0a0b76ea9b8c853e3cf4407edb7a3bcb Mon Sep 17 00:00:00 2001 From: ric-evans Date: Thu, 11 Apr 2024 19:24:00 -0500 Subject: [PATCH] move `TestHandler` --- tests/integrate_openapi/conftest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/integrate_openapi/conftest.py b/tests/integrate_openapi/conftest.py index 07ca52a0..cdd10abf 100644 --- a/tests/integrate_openapi/conftest.py +++ b/tests/integrate_openapi/conftest.py @@ -23,19 +23,19 @@ def port() -> int: s.close() return ephemeral_port - +class TestHandler(RestHandler): + ROUTE = "/echo/this" + + async def post(self) -> None: + self.write({}) + # if self.get_argument("raise", None): + # raise tornado.web.HTTPError(400, self.get_argument("raise")) + # self.write(self.get_argument("echo", {})) @pytest_asyncio.fixture async def server(port: int) -> AsyncIterator[Callable[[], RestClient]]: """Start up REST server and attach handlers.""" - class TestHandler(RestHandler): - ROUTE = "/echo/this" - async def post(self) -> None: - self.write({}) - # if self.get_argument("raise", None): - # raise tornado.web.HTTPError(400, self.get_argument("raise")) - # self.write(self.get_argument("echo", {})) rs = RestServer(debug=True) rs.add_route(TestHandler.ROUTE, TestHandler)