All Projects → kevin1024 → Vcrpy

kevin1024 / Vcrpy

Licence: mit
Automatically mock your HTTP interactions to simplify and speed up testing

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Vcrpy

Parrot
✨ Scenario-based HTTP mocking
Stars: ✭ 109 (-94.92%)
Mutual labels:  mocking
Fauxhai
Easily mock full ohai data
Stars: ✭ 134 (-93.75%)
Mutual labels:  mocking
Dingo
🐺 Easy, fast and type-safe dependency injection for Go.
Stars: ✭ 154 (-92.82%)
Mutual labels:  mocking
Spring Data Mock
Mock facility for Spring Data repositories
Stars: ✭ 110 (-94.87%)
Mutual labels:  mocking
Hoverfly Java
Java binding for Hoverfly
Stars: ✭ 130 (-93.94%)
Mutual labels:  mocking
Mockbin
Mock, Test & Track HTTP Requests and Response for Microservices
Stars: ✭ 1,782 (-16.88%)
Mutual labels:  mocking
Mockery
Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).
Stars: ✭ 10,048 (+368.66%)
Mutual labels:  mocking
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+480.83%)
Mutual labels:  mocking
Spy
Clojure/ClojureScript library for stubs, spies and mocks.
Stars: ✭ 131 (-93.89%)
Mutual labels:  mocking
Httpmocker
HttpMocker is a simple HTTP mocking library written in Kotlin to quickly and easily handle offline modes in your apps
Stars: ✭ 155 (-92.77%)
Mutual labels:  mocking
Nsubstitute
A friendly substitute for .NET mocking libraries.
Stars: ✭ 1,646 (-23.23%)
Mutual labels:  mocking
Mountebank
Over the wire test doubles
Stars: ✭ 1,678 (-21.74%)
Mutual labels:  mocking
Hoverfly
Lightweight service virtualization/API simulation tool for developers and testers
Stars: ✭ 1,814 (-15.39%)
Mutual labels:  mocking
Narwhal
A progressive test framework for C.
Stars: ✭ 110 (-94.87%)
Mutual labels:  mocking
Prism
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
Stars: ✭ 2,484 (+15.86%)
Mutual labels:  mocking
Really Need
Node require wrapper with options for cache busting, pre- and post-processing
Stars: ✭ 108 (-94.96%)
Mutual labels:  mocking
Duckrails
Development tool to mock API endpoints quickly and easily (docker image available)
Stars: ✭ 1,690 (-21.18%)
Mutual labels:  mocking
Examples
Examples of Mock Service Worker usage with various frameworks and libraries.
Stars: ✭ 163 (-92.4%)
Mutual labels:  mocking
Httpretty
Intercept HTTP requests at the Python socket level. Fakes the whole socket module
Stars: ✭ 1,930 (-9.98%)
Mutual labels:  mocking
Castlemock
Castle Mock is a web application that provides the functionality to mock out RESTful APIs and SOAP web services.
Stars: ✭ 153 (-92.86%)
Mutual labels:  mocking

VCR.py 📼

PyPI Python versions Build Status Code Coverage Status Join the chat at https://gitter.im/kevin1024/vcrpy Code Style: black


vcr.py logo

This is a Python version of Ruby's VCR library.

Source code
https://github.com/kevin1024/vcrpy
Documentation
https://vcrpy.readthedocs.io/

Rationale

VCR.py simplifies and speeds up tests that make HTTP requests. The first time you run code that is inside a VCR.py context manager or decorated function, VCR.py records all HTTP interactions that take place through the libraries it supports and serializes and writes them to a flat file (in yaml format by default). This flat file is called a cassette. When the relevant piece of code is executed again, VCR.py will read the serialized requests and responses from the aforementioned cassette file, and intercept any HTTP requests that it recognizes from the original test run and return the responses that corresponded to those requests. This means that the requests will not actually result in HTTP traffic, which confers several benefits including:

  • The ability to work offline
  • Completely deterministic tests
  • Increased test execution speed

If the server you are testing against ever changes its API, all you need to do is delete your existing cassette files, and run your tests again. VCR.py will detect the absence of a cassette file and once again record all HTTP interactions, which will update them to correspond to the new API.

Usage with Pytest

There is a library to provide some pytest fixtures called pytest-recording https://github.com/kiwicom/pytest-recording

License

This library uses the MIT license. See LICENSE.txt for more details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].