Responses
Metrics as of , from the GitHub or GitLab API of each repository. Refreshed monthly.
What Responses is
Responses is a Python utility library for mocking the requests library in tests. Mock responses are registered by URL and HTTP method and activated with a decorator or a context manager. Requests that match no registered response raise a ConnectionError. Matchers filter requests by body, query parameters, keyword arguments, multipart data, fragment identifiers and headers. Registries return responses in default, ordered or custom order. Callbacks produce dynamic responses. The separate pytest-responses package exposes it as a pytest fixture. Assertions check call counts and request data. A beta feature records responses to files and replays them. It requires Python 3.8 or newer and requests 2.30.0 or later.
Written from the project's README, read .
- Category
- Test data and mocking
- License
- Apache-2.0
- Language
- Python
- Changelog
- Releases on GitHub
Repository metrics
Status
activeLast commit within 90 days of the fetch date.Computed from the last commit date and the archive flag on the fetch date. See the status rules.
Alternatives
Listed test data and mocking tools, same primary language first, then by GitHub stars. Each line gives one fact from the tool's documentation where it differs from Responses's, with its source.
Faker: Languages for writing tests: Python (3.8 and above). source: README
Testcontainers Python: Languages for writing tests: Python. source: Docs: testcontainers-python
JSON Server: Protocols: HTTP (REST API routes for GET, POST, PUT, PATCH, DELETE). source: README
Mock Service Worker: Languages for writing tests: JavaScript. source: README
@faker-js/faker: Languages for writing tests: JavaScript (browser and Node.js). source: Docs: Getting Started
Mockito: Languages for writing tests: Java. source: README
Nock: Languages for writing tests: Node.js. source: README
Sinon.JS: Languages for writing tests: JavaScript. source: Docs: SinonJS home
How to install
pip install responsesQuestions
Is Responses open source?
Yes. Responses is released under Apache-2.0, an OSI-approved license, as reported by the GitHub API on 2026-09-22.
Is Responses maintained?
On 2026-09-22, the last commit to the default branch was on 2026-09-16, so the listed status is active. Rule: Last commit within 90 days of the fetch date.
How many GitHub stars does Responses have?
4,342 stars on 2026-09-22, from the GitHub API. The number is refreshed at each monthly update.
What language is Responses written in?
The repository's primary language, as reported by the GitHub API, is Python.
How do I install Responses?
The README gives this command: pip install responses
Sources
- GitHub REST API: repository, read
- GitHub REST API: commits, read
- GitHub REST API: latest release, read
- GitHub REST API: contributors, read
- README, read