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

Route requests to different cassette files depending on host #676

Closed
CaptainDriftwood opened this issue Dec 19, 2022 · 1 comment
Closed

Comments

@CaptainDriftwood
Copy link

CaptainDriftwood commented Dec 19, 2022

I have various hosts that I need to hit for a unit test. I'd like to be able to route the responses from each host to its own specific cassette file. The documentation does not appear to show an example of how to do this. Is there a recommended way of doing this?

@CaptainDriftwood CaptainDriftwood changed the title Use multiple cassettes for a single test Route requests to different cassette files depending on host Dec 21, 2022
@kevin1024
Copy link
Owner

Check out the path_transformer and func_path_generator configuration vars.

They are not well documented but I believe they will do what you want.

https://vcrpy.readthedocs.io/en/latest/advanced.html?highlight=path_transformer#automatic-cassette-naming

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

No branches or pull requests

2 participants