Closed northtree closed 4 years ago
Hello @northtree !
I think that at the moment --record-mode=new_episodes
might work, but depends - old requests will be still in cassettes and it might be not needed.
We can add a new command-line flag to provide this behavior, for example --rewrite-cassettes
- it will remove cassettes automatically before recording. What do you think?
@Stranger6667
I'm a little confused about --record-mode=new_episodes
from VCR doc.
Record new interactions. Replay previously recorded interactions.
Is ^^ replay one (Step 2) the new recorded in this run (Step 1), or from previous run (aka from yaml)?
Is ^^ replay one (Step 2) the new recorded in this run (Step 1), or from previous run (aka from yaml)?
From the previous run, so the requests are not actually updated, only new ones are added
Is ^^ replay one (Step 2) the new recorded in this run (Step 1), or from previous run (aka from yaml)?
From the previous run, so the requests are not actually updated, only new ones are added
Thanks. I just wonder why VCR.py didn't provide overwrite mode, which is quite intuitive for beginner?
@Stranger6667
Another question not related to this issue: If the user doesn't provide any param for record-mode
, what's the related mode in VCR.py will be used?
none
will be used, as the safest default :)
Thanks. I just wonder why VCR.py didn't provide overwrite mode, which is quite intuitive for beginner?
We can either propose to add such mode there (it will be really convenient) or implement it here
none
will be used, as the safest default :)
After installed pytest-recording
, is there any option we could use to run tests without using VCR (aka accessing cassettes) ? I would like to have this option without manually comment out @pytest.mark.vcr
for each test.
After installed pytest-recording, is there any option we could use to run tests without using VCR (aka accessing cassettes) ?
Yep, for example:
pytest -p no:recording
will disable VCR usage via this plugin completely
pytest -p no:recording
will disable VCR usage via this plugin completely
However, there will have PytestUnknownMarkWarning
.
PytestUnknownMarkWarning: Unknown pytest.mark.vcr - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
If the response is changed, how could I just update the specify test without manually remove YAML file?