Skip to content

Commit 51cdda8

Browse files
Add host parameter to aiohttp_server fixture (#10120) (#10121) (#10150)
Co-authored-by: ChristianWBrock <christian.brock AT posteo.net> (cherry picked from commit 7f8e2d3) Co-authored-by: christianwbrock <christian.brock@posteo.net>
1 parent eb42db8 commit 51cdda8

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
@@ -301,9 +301,13 @@ def aiohttp_server(loop: asyncio.AbstractEventLoop) -> Iterator[AiohttpServer]:
301301
servers = []
302302

303303
async def go(
304-
app: Application, *, port: Optional[int] = None, **kwargs: Any
304+
app: Application,
305+
*,
306+
host: str = "127.0.0.1",
307+
port: Optional[int] = None,
308+
**kwargs: Any,
305309
) -> TestServer:
306-
server = TestServer(app, port=port)
310+
server = TestServer(app, host=host, port=port)
307311
await server.start_server(loop=loop, **kwargs)
308312
servers.append(server)
309313
return server

0 commit comments

Comments
 (0)