frost-nzcr4 / pytest-vcr

Py.test integration with VCR.py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytest-vcr

See Build Status on Travis CI See Build Status on AppVeyor See the documentation

Py.test plugin for managing VCR.py cassettes.

Quick Start

Install the plugin:

pip install pytest-vcr

Annotate your tests:

@pytest.mark.vcr()
def test_iana():
    response = urlopen('http://www.iana.org/domains/reserved').read()
    assert b'Example domains' in response

And that's it! A new file cassettes/test_iana.yaml will be created next to your test file on the first run. This file should be committed to a VCS.

For more examples and configuration options see the documention on ReadTheDocs.

About

Py.test integration with VCR.py

License:MIT License


Languages

Language:Python 100.0%