Use pytest-recording for VCR tests
We can interface with VCR.py through pytest-recording for flexible config in tests and in the Pytest CLI. The project is actively maintained edit though some lingering conda-forge PRs need addressed edit. In doing so we can:
- Toggle VCR record mode to none in CI via pytest flag. This disallows updating existing cassettes with new requests and recording new cassettes if they don't exist, eg test is added and decorated without checking in a cassette from local
- Can eliminate
needs_awsto rely on our existing functionality more explicitly and generally - Can config VCR.py, add extra cassettes, etc. in pytest scopes (per-function decorator, per-module config, etc.) And config inherits and overwrites predictably.
I also tried configuring VCR to fail to write new cassettes on exceptions in tests, but the behavior wasn't what I expected.
There are other reasonable ways to configure this, and I don't think we have to take on this pytest-recording dep. Still, I got sniped and wanted to open a PR to show it for discussion. We can get most of this with VCR.py config directly. I have also yet to reimplement the behavior to skip tests if no VCR - tougher with a pytest plugin.
If we do move forward I will take this opportunity to update the dev guide with instructions.
- [ ] Fully documented