Skip to content

Commit

Permalink
docs: add drop_unused_requests option
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnsilva committed Jan 4, 2023
1 parent 010fa26 commit 36c7465
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,16 @@ If you want to save the cassette only when the test succeedes, set the Cassette
# Since there was an exception, the cassette file hasn't been created.
assert not os.path.exists('fixtures/vcr_cassettes/synopsis.yaml')
Drop unused requests
--------------------

Even if any HTTP request is changed or removed from tests, previously recorded
interactions remain in the cassette file. If set the ``drop_unused_requests``
option to ``True``, VCR will not save old HTTP interactions if they are not used.

.. code:: python
my_vcr = VCR(drop_unused_requests=True)
with my_vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'):
# your http here

0 comments on commit 36c7465

Please sign in to comment.