vcrpy: Simplify and Speed Up Python HTTP Testing

This repository profile is provided by osrepos.com, an open source repository discovery platform.

vcrpy: Simplify and Speed Up Python HTTP Testing

Summary

vcrpy is a Python library that automatically mocks your HTTP interactions, making testing simpler and significantly faster. Inspired by Ruby's VCR, it records HTTP requests and responses to a 'cassette' file during the first test run, then replays them in subsequent runs, eliminating actual network traffic. This approach ensures deterministic tests, allows offline development, and boosts test execution speed.

Repository Information

Analyzed by OSRepos on August 3, 2026

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

vcrpy is a powerful Python library designed to simplify and accelerate the testing of applications that make HTTP requests. It acts as a 'cassette recorder' for your network interactions, inspired by the popular Ruby VCR library. By recording and replaying HTTP traffic, vcrpy helps developers create robust and efficient test suites.

Installation

Installing vcrpy is straightforward using pip:

pip install vcrpy

Examples

The core concept of vcrpy involves wrapping your code that makes HTTP requests within a context manager or decorating a function. The first time this code runs, vcrpy records all HTTP interactions to a YAML file, known as a 'cassette'. On subsequent runs, vcrpy intercepts these requests and serves the recorded responses from the cassette, bypassing actual network calls.

Why use vcrpy?

Using vcrpy offers several significant advantages for testing:

  • Work Offline: Develop and run tests without an active internet connection.
  • Deterministic Tests: Ensure your tests always produce the same results, free from external API flakiness or changes.
  • Increased Test Speed: Eliminate slow network requests, drastically speeding up your test suite execution.

If an external API changes, simply delete the old cassette files, and vcrpy will record new interactions on the next test run.

Links

Find more information and contribute to vcrpy through these official links:

Related repositories

Similar repositories that may be relevant next.

httmock: A Powerful Mocking Library for Python Requests

httmock: A Powerful Mocking Library for Python Requests

August 3, 2026

httmock is an essential Python library designed for mocking HTTP requests made by the popular `requests` library. It allows developers to easily simulate API responses, making it ideal for testing applications that interact with external services. With httmock, you can control network interactions, ensuring reliable and repeatable tests without relying on actual network calls.

httpmockpython
Mocket: A Comprehensive Socket Mocking Framework for Python

Mocket: A Comprehensive Socket Mocking Framework for Python

August 3, 2026

Mocket is a powerful Python framework designed for monkey-patching the `socket` and `ssl` modules, enabling robust testing of network-dependent applications. It serves as both a low-level framework for building custom clients and a ready-to-use mock for HTTP/HTTPS calls, supporting various environments including asyncio and MicroPython. This tool simplifies the process of isolating and testing Python clients that communicate over the socket protocol.

pythontestingmocking
Werkzeug: A Comprehensive WSGI Web Application Library for Python

Werkzeug: A Comprehensive WSGI Web Application Library for Python

July 22, 2026

Werkzeug is a comprehensive WSGI web application library, providing essential tools for building web applications in Python. It includes an interactive debugger, robust request and response objects, a flexible routing system, and various HTTP utilities. This powerful library serves as the foundation for popular frameworks like Flask, offering developers significant flexibility without enforcing specific dependencies.

werkzeugpythonwsgi
Piping Server: Infinite Data Transfer Over Pure HTTP

Piping Server: Infinite Data Transfer Over Pure HTTP

June 20, 2026

Piping Server is an innovative open-source project enabling infinite data transfer between any device over pure HTTP. It acts as a simple, storageless server, facilitating data streaming with just `curl` or a web browser. This makes it ideal for secure, real-time communication and large file transfers without requiring any installation.

data-transferhttpstream

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️