vcrpy vs httmock

Python HTTP testing libraries compared

vcrpy records HTTP interactions to cassette files and replays them in later test runs. httmock intercepts requests made through `requests` and returns responses configured for the test, so the main difference is replaying recorded traffic versus defining mocked responses.

vcrpyhttmock
LanguagePythonPython
LicenseMIT—
Stars3k471
Forks44457
Last analyzedOct 3, 2026Oct 19, 2026

Key differences

  • vcrpy records real HTTP interactions on an initial run; httmock supplies mocked responses without contacting live services.
  • vcrpy replays matching requests from cassette files, with YAML as its default format; httmock uses URL-matching decorators or handlers active in an `HTTMock` context.
  • vcrpy supports HTTP traffic through libraries it supports; httmock is designed specifically for the `requests` library.
  • httmock lets tests configure response status codes, content, headers, and cookies; vcrpy returns saved responses from recorded interactions.
  • vcrpy is listed with an MIT license and 3k stars; httmock is listed with license `NOASSERTION` and 472 stars.

Choose vcrpy if you…

  • need to replay recorded HTTP interactions from cassette files.
  • want tests to run offline after recording the required interactions.
  • need to refresh test fixtures by recording interactions again.
Read the vcrpy analysis →

Choose httmock if you…

  • want to define mocked responses for requests made through `requests`.
  • need to configure response status, content, headers, or cookies in tests.
  • want to match selected URLs while leaving unmatched requests unaffected by conditional matching.
Read the httmock 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.