--- id: starlette-testclient version: "0.4.1" license: unclear license_treatment: permissive maintenance: dormant --- # starlette-testclient — A backport of Starlette TestClient using requests! ⏪️ License: permissive · Maintenance: dormant · Downloads: 2.8M/mo ## What it is and what it does starlette-testclient is a backport of Starlette's TestClient that swaps out httpx for requests as the underlying HTTP library. It exists as a migration aid: if your codebase still uses requests for testing and you're not ready to switch to httpx, this package lets you keep that pattern without forking Starlette's test utilities. You import from starlette_testclient instead of starlette.testclient and get the same TestClient interface backed by requests. The package depends on requests and starlette as runtime libraries and supports Python 3.7 through 3.12. It is classified as Alpha and has not been actively maintained for over two years, so it functions as a compatibility shim rather than an evolving tool. No known security vulnerabilities are recorded. Use it for: - Testing applications in codebases that standardize on requests and cannot yet migrate to httpx. - Gradual migration: use this backport while transitioning test suites from requests to httpx-based clients. - Legacy projects: maintain existing test patterns in older applications without rewriting test infrastructure. - Minimal dependency footprint: avoid adding httpx to projects that already have requests as a core dependency. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a drop-in replacement for Starlette's TestClient that uses requests instead of httpx for testing Starlette applications. Yes, if you are actively migrating away from this package or need a temporary requests-based TestClient for an existing codebase. No, if you are starting a new project—use the native httpx-based TestClient instead. The dormant maintenance status means this is a bridge tool, not a long-term solution; plan to migrate to the standard TestClient. ## Install pip install starlette-testclient uv add starlette-testclient poetry add starlette-testclient ## Installing starlette-testclient Before you install: Low friction: pure Python wheel with only two runtime dependencies (requests and starlette). Maintenance is dormant—last release was 837 days ago—so expect no active updates or bug fixes. License in practice: BSD 3-Clause permissive license means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions. Quickstart: pip install starlette-testclient from starlette_testclient import TestClient Verify before relying: - Whether this backport remains compatible with current starlette versions beyond the last release date. - Whether requests-based testing covers all httpx-specific behaviors needed for comprehensive testing. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 2.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags starlette testing with requests, testclient requests backport, starlette app testing, http client testing starlette, starlette test utilities, requests-based test client, testclient migration, starlette, testing, migration-aid [View on SkillFed](https://skillfed.io/packages/starlette-testclient) · [View on PyPI](https://pypi.org/project/starlette-testclient/)