Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktosiek/pytest-vcr
Py.test integration with VCR.py
https://github.com/ktosiek/pytest-vcr
Last synced: 30 days ago
JSON representation
Py.test integration with VCR.py
- Host: GitHub
- URL: https://github.com/ktosiek/pytest-vcr
- Owner: ktosiek
- License: mit
- Created: 2017-05-07T11:54:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-07T09:19:18.000Z (over 2 years ago)
- Last Synced: 2024-11-09T02:19:05.442Z (about 1 month ago)
- Language: Python
- Size: 55.7 KB
- Stars: 154
- Watchers: 4
- Forks: 24
- Open Issues: 19
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
##########
pytest-vcr
##########|Travis| |AppVeyor| |ReadTheDocs|
.. |Travis| image:: https://travis-ci.org/ktosiek/pytest-vcr.svg?branch=master
:target: https://travis-ci.org/ktosiek/pytest-vcr
:alt: See Build Status on Travis CI
.. |AppVeyor| image:: https://ci.appveyor.com/api/projects/status/github/ktosiek/pytest-vcr?branch=master
:target: https://ci.appveyor.com/project/ktosiek/pytest-vcr/branch/master
:alt: See Build Status on AppVeyor
.. |ReadTheDocs| image:: https://readthedocs.org/projects/pytest-vcr/badge/?version=latest
:target: http://pytest-vcr.readthedocs.io/en/latest/?badge=latest
:alt: See the documentationPy.test plugin for managing `VCR.py `_ cassettes.
Quick Start
===========Install the plugin:
.. code-block:: sh
pip install pytest-vcr
Annotate your tests:
.. code-block:: python
@pytest.mark.vcr()
def test_iana():
response = urlopen('http://www.iana.org/domains/reserved').read()
assert b'Example domains' in responseAnd 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 `_.