kevin1024 / vcrpy

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

Improved message on CannotOverwriteExistingCassetteException with no failed matchers #673

Open edthedev opened 1 year ago

edthedev commented 1 year ago

Context

Per discussion here: Originally posted by @salomvary in https://github.com/kevin1024/vcrpy/issues/533#issuecomment-1269519939

CannotOverwriteExistingCassetteException can be raised along with 'no matchers failed' as the message details.

In many cases, setting vcr.allow_playback_repeats for the affected test will clear the issue.

Proposal

Update the error handler to recognize this corner case and emit a message encouraging developers to consider whether they need to set vcr.allow_playback_repeats