Open svtkachenko opened 5 years ago
Hello @ktosiek !
Thank you for this library! It helps us a lot :) We'd be very grateful if customizing cassette name feature will be present in pytest-vcr
. It could really help us to reduce duplicate/similar cassettes number (now we use vcr.use_cassette
decorator to handle this). I hope, that these changes wouldn't take much of your time to review. 🍰
Have a nice day, Dmitry
I have a PR accepted on VCRpy but am awaiting a release to PyPI officially
In the mean time, unofficially, you can use forks of these libraries by pip installing from github links if that helps.
https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch
Not sure if the mentioned MR is related to the problem with lacking support for custom test names.
The issue is solved here - https://github.com/kiwicom/pytest-recording
We decided to rewrite the whole pytest integration with awareness on #25 and #24. Also, it supports multiple cassettes (which reduces duplication dramatically in our case) and writes cassettes in different directories per test module to avoid clashing cassette names when there are the same test names in different test modules.
Hi, please review if this change is valid and could be used.
Motivation for the change: I'd like to have default behavior for some tests (
test_path/cassettes/test_name.yaml
) but at the same time I'd like to reuse cassettes with same requests. It is not possible for me to store all tests in the same shared directory (e.g. by re-definingvcr_cassette_dir
) as some tests can have same name but different location and different requests.