starlette-testclient
A backport of Starlette TestClient using requests! ⏪️
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
permissive license (permissive) — BSD 3-Clause permissive license means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2024-04-29 (837 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,751,808 downloads/mo, #2,906 on PyPI
Alternatives
Verify before relying
pip install starlette-testclient
from starlette_testclient import TestClient- 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.
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 on this page. Verify before relying on it.
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
starlette-testclient on PyPI
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 | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesrequestsstarlette |
| Maintenance | Dormant 837 days since the last release |
| First released | |
| Downloads | 2,751,808 / month, #2,906 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: starlette_testclient-0.4.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “starlette testing with requests”
- starlette-testclientProvides a drop-in replacement for Starlette's TestClient that uses…
- opentelemetry-instrumentation-starletteAdds automatic tracing and observability instrumentation to Starlette…
- starlette-prometheusAdds Prometheus metrics collection and exposure to Starlette web…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also async-asgi-testclient · starlette · aiohttp-asgi-connector · apimatic-requests-client-adapter · starlette-cramjam · starlette-prometheus · opentelemetry-instrumentation-starlette · starlette-context · Secweb · niquests