aiohttp-asgi-connector
AIOHTTP Connector for running ASGI applications
What it is and what it does
aiohttp-asgi-connector is a custom connector for AIOHTTP's ClientSession that routes HTTP requests directly into ASGI applications without requiring a running web server. It's designed to close the gap between AIOHTTP and HTTPX's testing capabilities, letting you test ASGI apps by making async HTTP calls that bypass the network stack entirely.
The connector replaces AIOHTTP's entire connection and transport layer. You instantiate it with your ASGI app, pass it to ClientSession, and then use the session normally—requests are serialized by AIOHTTP and fed directly to the app. Exceptions raised in the app propagate back to your test code. The main limitation is that if you enable chunking or compression on the ClientSession, your ASGI app must handle decompression itself, since the connector transmits requests exactly as AIOHTTP serializes them.
Use it for:
- Unit testing ASGI endpoints without spinning up a test server.
- Integration testing ASGI applications in test suites where you want to avoid network overhead.
- Verifying request/response handling in ASGI middleware without HTTP transport.
- Debugging ASGI app behavior by inspecting requests and responses in-process during tests.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an AIOHTTP connector that lets you test ASGI applications by routing ClientSession requests directly to them without a web server.
Yes, if you're already using AIOHTTP and testing ASGI applications. It's a low-friction, permissive-licensed tool that solves a specific problem well. The aging maintenance status (418 days since last release) is a minor concern for a stable, narrow-scope library, but monitor the repository for responsiveness if you encounter issues.
Install
aiohttp-asgi-connector on PyPI
pip
pip install aiohttp-asgi-connectoruv
uv add aiohttp-asgi-connectorpoetry
poetry add aiohttp-asgi-connectorInstalling aiohttp-asgi-connector
Before you install
Low friction: pure Python wheel, single runtime dependency on aiohttp. Maintenance status is aging—last release was 418 days ago—so expect slower response to issues, though the package remains functional for its narrow use case.
License in practice
BSD 3-Clause is permissive; you can use this in commercial and proprietary projects with minimal restriction, provided you retain the license notice.
Quickstart
from aiohttp_asgi_connector import ASGIApplicationConnector
from aiohttp import ClientSession
connector = ASGIApplicationConnector(app)
async with ClientSession(connector=connector) as session:
resp = await session.get("/")
data = await resp.json()
Requires Python 3.8+; aiohttp 3.1+ must be installed. ASGI lifespan events are not handled—use asgi-lifespan if you need them.
Verify before relying
- Whether chunked uploads or compression on the ClientSession are transparently handled or require manual decompression in the ASGI app.
- Current maintenance responsiveness given the 418-day gap since last release.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — aiohttp |
| Maintenance | aging — 418 days since the last release |
| First released | |
| Downloads | 120,850/month — #12,007 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: aiohttp_asgi_connector-1.1.2-py3-none-any.whl
Keywords: fastapi, aiohttp, asgi, testing, starlette, httpx, asyncio
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
asgi-lifespanProgrammatically trigger ASGI application…
permissive · top 5,000 on PyPI
starlette-testclientProvides a drop-in replacement for Starlette's…
permissive · top 5,000 on PyPI
httpx-aiohttpProvides aiohttp-based transports for httpx,…
unclear · top 5,000 on PyPI
async-asgi-testclientProvides an async test client for ASGI web…
permissive · top 15,000 on PyPI
aioresponsesMocks HTTP requests made by aiohttp's…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-asgiProvides ASGI middleware for OpenTelemetry that…
permissive · top 1,000 on PyPI
hishelHishel is an HTTP caching library for Python…
permissive · top 5,000 on PyPI
aioprometheusA Prometheus client library for asyncio…
permissive · top 15,000 on PyPI
aiohttp_socksProvides a proxy connector for aiohttp that…
permissive · top 5,000 on PyPI
aiointerceptIntercepts aiohttp client requests by routing…
permissive · top 15,000 on PyPI