Skip to content

Commit 7f8e2d3

Browse files
Add host parameter to aiohttp_server fixture (#10120) (#10121)
Co-authored-by: ChristianWBrock <christian.brock AT posteo.net>
1 parent 6200513 commit 7f8e2d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGES/10120.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added ``host`` parameter to ``aiohttp_server`` fixture -- by :user:`christianwbrock`.

aiohttp/pytest_plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,13 @@ def aiohttp_server(loop: asyncio.AbstractEventLoop) -> Iterator[AiohttpServer]:
304304
servers = []
305305

306306
async def go(
307-
app: Application, *, port: Optional[int] = None, **kwargs: Any
307+
app: Application,
308+
*,
309+
host: str = "127.0.0.1",
310+
port: Optional[int] = None,
311+
**kwargs: Any,
308312
) -> TestServer:
309-
server = TestServer(app, port=port)
313+
server = TestServer(app, host=host, port=port)
310314
await server.start_server(**kwargs)
311315
servers.append(server)
312316
return server

0 commit comments

Comments
 (0)