kevin1024 / vcrpy

Automatically mock your HTTP interactions to simplify and speed up testing
MIT License
2.72k stars 388 forks source link

Add an option to remove unused requests from cassette #677

Closed danielnsilva closed 1 year ago

danielnsilva commented 1 year ago

This PR adds an option to remove previously recorded interactions if they are not used. I believe this feature can address the issue discussed in #208. We don't need to focus on ignoring all requests in the cassette file, but instead, we can write to file only replayed interactions and new ones. If no previous request is used, VCR will save only new interactions.

There is a similar feature (merged, but not released) in Ruby VCR.