async-asgi-testclient
Async client for testing ASGI web applications
What it is and what it does
async-asgi-testclient is a testing library for ASGI web applications that avoids the complexity of running a separate HTTP server during tests. Instead of spawning the app in a different process or thread, it calls the ASGI application directly within the same asyncio loop. This approach simplifies test writing and debugging by keeping everything in a single execution context.
The library is framework-agnostic, meaning it works with any ASGI-compliant framework without depending on framework-specific testing utilities. It supports cookies, multipart form data, redirects, response and request streams, and WebSocket connections. The package has no runtime dependencies, making it lightweight to add to a test suite.
Use it for:
- Testing ASGI applications without running a live HTTP server during CI/CD pipelines.
- Writing async unit tests for ASGI middleware and route handlers with direct app invocation.
- Testing WebSocket endpoints and streaming responses in async ASGI applications.
- Debugging ASGI app behavior by keeping test and app code in the same asyncio event loop.
- Testing multipart form uploads and cookie handling in async web frameworks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides an async test client for ASGI web applications that calls the app directly without spawning a separate HTTP server, supporting both ASGI 2 and 3 specifications.
No, with caution. While the package is lightweight and permissively licensed, it has been abandoned with no releases since 2022-06-13. The ASGI ecosystem has evolved significantly since then, and there is no evidence of ongoing maintenance or compatibility with modern Python or framework versions. Use only if locked into an older codebase; for new projects, prefer actively maintained testing clients.
Install
async-asgi-testclient on PyPI
pip
pip install async-asgi-testclientuv
uv add async-asgi-testclientpoetry
poetry add async-asgi-testclientInstalling async-asgi-testclient
Before you install
High install friction reported. Package is in abandoned maintenance status with no releases since 2022-06-13, over 1523 days ago. Last repository commit was 2023-06-29. While classifiers claim production stability, the lack of recent updates means compatibility with current Python or ASGI ecosystem versions is uncertain.
License in practice
MIT license (permissive). You can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install async-asgi-testclient
from async_asgi_testclient import TestClient
async with TestClient(app) as client:
resp = await client.get("/")
assert resp.status_code == 200
Requires Python 3.6+; designed for use with async test frameworks.
Verify before relying
- Whether the package works with current ASGI 3 implementations and modern async frameworks given the maintenance gap.
- Compatibility with Python versions beyond 3.10 (classifiers only list up to 3.10).
- Whether websocket, multipart, and stream support remain functional with current ASGI ecosystem changes.
Package facts
| License | MIT license (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,523 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 288,647/month — #8,017 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: async-asgi-testclient-1.4.11.tar.gz
Keywords: async, asgi, testclient
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
opentelemetry-instrumentation-asgiProvides ASGI middleware for OpenTelemetry that…
permissive · top 1,000 on PyPI
a2wsgiConverts between WSGI and ASGI applications…
permissive · top 5,000 on PyPI
starletteStarlette is a lightweight ASGI framework for…
permissive · top 100 on PyPI
QuartQuart is an async Python web framework that…
permissive · top 5,000 on PyPI
responsesMocks HTTP requests made by the requests…
permissive · top 1,000 on PyPI
aiohttp-asgi-connectorProvides an AIOHTTP connector that lets you…
permissive · top 15,000 on PyPI
opentelemetry-util-httpProvides ASGI and WSGI middleware and HTTP…
permissive · top 1,000 on PyPI
timing-asgiTiming-asgi is an ASGI middleware that…
unclear · top 15,000 on PyPI