responses vs vcrpy

Python HTTP testing: registered mocks or recorded replays

responses and vcrpy both help Python developers test code that makes HTTP requests without relying on live services on every test run. responses serves registered mock responses, while vcrpy records real interactions to cassette files and replays them later.

responsesvcrpy
LanguagePythonPython
LicenseApache-2.0MIT
Stars4.3k3k
Forks386444
Last analyzedOct 3, 2026Oct 3, 2026

Key differences

  • responses targets the Python requests library; vcrpy supports HTTP traffic through libraries it supports, with compatibility details in its documentation.
  • responses uses registered responses, matchers, callbacks, and optional ordered sequences; vcrpy replays interactions saved in cassette files.
  • responses can test immediately with configured mocks; vcrpy needs an initial run that reaches the service to record interactions before offline replay.
  • responses lists Apache-2.0 licensing, while vcrpy lists MIT licensing.
  • responses supports passthrough rules and call-count assertions; vcrpy emphasizes refreshing recorded fixtures by removing cassette files and recording again.

Choose responses if you…

  • need to define expected status codes, headers, bodies, or request data directly in tests.
  • want callbacks or ordered responses to model changing server behavior.
  • need call history, call-count assertions, or rules for allowing selected requests through.
Read the responses analysis →

Choose vcrpy if you…

  • want to capture real HTTP interactions and replay them from YAML-default cassette files.
  • need tests to run offline after the required interactions have been recorded.
  • prefer updating test fixtures by recording interactions again after API changes.
Read the vcrpy analysis →

Compare the numbers side by side, or add more projects

This comparison is generated with AI from the OSRepos analyses of both projects. Always check each project's repository and documentation before choosing.