Skip to main content

A pytest plugin that allows to record network interactions via VCR.py

Project description

codecov Build Version Python versions License

WIP

A pytest plugin that allows to record network interactions via VCR.py.

Features

  • Straightforward pytest.mark.vcr, that reflects VCR.use_cassettes API;

  • Combining multiple VCR cassettes;

Usage

import pytest
import requests

@pytest.mark.vcr("/path/to/ip.yaml", "/path/to/get.yaml")
def test_multiple():
    assert requests.get("http://httpbin.org/get").text == "GET CONTENT"
    assert requests.get("http://httpbin.org/ip").text == "IP CONTENT"

# cassettes/test_single.yaml will be used
def test_single():
    assert requests.get("http://httpbin.org/get").text == "GET CONTENT"

Python support

Pytest-recording supports Python 2.7, 3.5, 3.6, 3.7 and 3.8.

License

The code in this project is licensed under MIT license. By contributing to pytest-recording, you agree that your contributions will be licensed under its MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pytest_recording-0.1.0-py2.py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page