Skip to content

Commit 36c7465

Browse files
committed
docs: add drop_unused_requests option
1 parent 010fa26 commit 36c7465

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/advanced.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,3 +426,16 @@ If you want to save the cassette only when the test succeedes, set the Cassette
426426
427427
# Since there was an exception, the cassette file hasn't been created.
428428
assert not os.path.exists('fixtures/vcr_cassettes/synopsis.yaml')
429+
430+
Drop unused requests
431+
--------------------
432+
433+
Even if any HTTP request is changed or removed from tests, previously recorded
434+
interactions remain in the cassette file. If set the ``drop_unused_requests``
435+
option to ``True``, VCR will not save old HTTP interactions if they are not used.
436+
437+
.. code:: python
438+
439+
my_vcr = VCR(drop_unused_requests=True)
440+
with my_vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml'):
441+
# your http here

0 commit comments

Comments
 (0)