Open Peque opened 1 year ago
Hi!
Yep, it could be a new CLI option that would work inside this condition elif vcr_markers or enable_recording:
This feature should be relatively straightforward to implement, I don't have the capacity to work on it myself but I will assist with reviews. I see the following steps:
--disable-recording
there)enable_recording
(similar to this)enable_recording
fixture inside vcr
- elif vcr_markers or enable_recording:
--disable-recording
and --enable-recording
are not used together (e.g. inside these fixture definitions)
It seems like right now you need to define which functions will make use of
vcr
with a decorator. It would be great if there was a way to automatically enablevcr
for all tests without requiring any change in the source code.For example, having a flag like
pytest --vcr
would automatically enable VCR for all requests.This way, tests would run in any environment without
vcr
norpytest-recording
installed (i.e.: CI/CD/deployment) and, for those wanting to accelerate local testing, it would be as simple as installing the packages and adding the--vcr
flag.Not sure this is even possible. :shrug: :smile: