--- id: sanic-testing version: "24.6.0" license: MIT license_treatment: permissive maintenance: dormant --- # sanic-testing — Core testing clients for Sanic License: permissive · Maintenance: dormant · Downloads: 220.8K/mo ## What it is and what it does sanic-testing is a standalone test utility package extracted from Sanic core, providing both synchronous and asynchronous HTTP test clients for Sanic applications. It attaches itself to a Sanic instance via TestManager and exposes test_client (for sync tests) and asgi_client (for async tests) that can execute application handlers without standing up a server or making actual network calls. The package depends on httpx for HTTP functionality and is designed to maintain API compatibility with the original sanic.testing module. It supports Python 3.8 through 3.12 and is classified as Beta. The async client is particularly useful for testing async handlers directly without server overhead. Use it for: - Write unit tests for Sanic route handlers using synchronous test_client to verify responses and status codes - Test async Sanic handlers with asgi_client in pytest-asyncio to execute application logic in-process - Migrate existing Sanic tests from the deprecated sanic.testing module to this standalone package - Verify request/response behavior for Sanic middleware and error handlers without network calls ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides sync and async test clients for testing Sanic web applications without requiring a running server. Yes, if you are testing Sanic applications. The package is stable (Beta, no known vulnerabilities) and has low install friction. However, note that maintenance is dormant—last release was 775 days ago—so verify compatibility with your Sanic version before adopting. It is the intended successor to sanic.testing and remains the standard testing tool for Sanic. ## Install pip install sanic-testing uv add sanic-testing poetry add sanic-testing ## Installing sanic-testing Before you install: Low install friction with a single runtime dependency (httpx). Maintenance is dormant—last release was 775 days ago—but the repository remains active and the package is marked Beta. Use with awareness that updates may be infrequent. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install sanic-testing from sanic import Sanic from sanic_testing import TestManager sanic_app = Sanic(__name__) TestManager(sanic_app) # Now use app.test_client or app.asgi_client in tests Verify before relying: - Whether the package remains compatible with recent Sanic versions given the dormant maintenance status - Whether pytest-asyncio is required as a runtime dependency or only for async test examples ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 220.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sanic testing client, test sanic applications, async http test client, sanic unit testing, web framework testing, sanic asgi client, http request testing, sanic-framework, http-testing, async-support [View on SkillFed](https://skillfed.io/packages/sanic-testing) · [View on PyPI](https://pypi.org/project/sanic-testing/)