Skip to content

Commit

Permalink
Add host parameter to aiohttp_server fixture (#10120) (#10121)
Browse files Browse the repository at this point in the history
Co-authored-by: ChristianWBrock <christian.brock AT posteo.net>
  • Loading branch information
christianwbrock authored Dec 9, 2024
1 parent 6200513 commit 7f8e2d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/10120.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added ``host`` parameter to ``aiohttp_server`` fixture -- by :user:`christianwbrock`.
8 changes: 6 additions & 2 deletions aiohttp/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,13 @@ def aiohttp_server(loop: asyncio.AbstractEventLoop) -> 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
Expand Down

0 comments on commit 7f8e2d3

Please sign in to comment.