diff --git a/docs/advanced.rst b/docs/advanced.rst index fb287fa3..b335aa83 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -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