kiwicom / pytest-recording

A pytest plugin that allows recording network interactions via VCR.py
MIT License
425 stars 34 forks source link

[QUESTION] How to rewind a casette? #72

Closed rgreinho closed 3 years ago

rgreinho commented 3 years ago

Describe the problem Is it possible to rewind a cassette using pytest-recording?

Basically I am trying to reproduce this use case: https://vcrpy.readthedocs.io/en/latest/advanced.html#rewind-cassette

If so updating the documentation would be great, and I'll be happy to write the update if there is a solution to this problem.

rgreinho commented 3 years ago

I did find the answer in the article that was linked in the README!

Use the pytest.mark.vcr decorator like this:

@pytest.mark.vcr(
   "YOUR_PREFERED_CASSETTE_NAME.yaml",
   allow_playback_repeats=True
)

I'll send a patch to add this to the README directly, as I think it is a very useful information.