Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify custom cassette path per test. #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Allow to specify custom cassette path per test. #25

wants to merge 2 commits into from

Conversation

svtkachenko
Copy link

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-defining vcr_cassette_dir) as some tests can have same name but different location and different requests.

@Stranger6667
Copy link

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

@neozenith
Copy link

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

@Stranger6667
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants