From 7aaad0b386d874522463e750d9a12f22e7c9e014 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Mon, 9 Dec 2024 20:06:27 +0000 Subject: [PATCH] Add host parameter to aiohttp_server fixture (#63) --- pytest_aiohttp/plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pytest_aiohttp/plugin.py b/pytest_aiohttp/plugin.py index 751b5de..c626352 100644 --- a/pytest_aiohttp/plugin.py +++ b/pytest_aiohttp/plugin.py @@ -82,9 +82,13 @@ async def aiohttp_server() -> Iterator[AiohttpServer]: servers = [] async def go( - app: Application, *, port: Optional[int] = None, **kwargs: Any + app: Application, + *, + host: str = "127.0.0.1", + port: Optional[int] = None, + **kwargs: Any, ) -> TestServer: - server = TestServer(app, port=port) + server = TestServer(app, host=host, port=port) await server.start_server(**kwargs) servers.append(server) return server