Dynamically generate cassette's name
See original GitHub issueAt the moment you have to explicitly name the cassette file in the path parameter when using a decorator:
@vcr.use_cassette('article_header.yaml')
def test_get_article_header_text_from_url():
# rest of function...
# cassette is saved as 'article_header.yaml'
Is it possible to dynamically generate cassette’s name so it’s taken from the decorated function instead?
@vcr.use_cassette(func_name)
def test_get_article_header_text_from_url():
# rest of function...
# cassette is saved as 'test_get_article_header_text_from_url.yaml'
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Naming - Cassettes - Vcr - Relish
When inserting or using a cassette, the first argument is the cassette name. You can use any string for the name. If you...
Read more >how do I dynamically generate multiple HTTP mock responses ...
Show activity on this post. I'm hitting an API and for each request, there was a recorded request/response in the cassette YAML file....
Read more >fastly/blockbuster: VCR cassette manager - GitHub
Blockbuster. Build Status. Managing your VCR cassettes since 2016. The task of this gem is to take all your VCR cassettes and package...
Read more >Cassette tape - Wikipedia
One artifact found on some commercially produced music cassettes was a sequence of test tones, called SDR (Super Dynamic Range, also called XDR,...
Read more >best practices, test::unit, cassette per test? erasing cassettes?
a a cassette name based on the name you pass in. Does this seem like ... it on what Rails does with Test::Unit,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@klvbdmh You should be able to do what you want now with this tiny bit of additional configuration:
@kevin1024 I should have held off on putting this in master until you got a chance to take a look at it. I’m pretty happy with how things turned out, but the code is definitely more complicated, and though this is completely backwards compatible, there are some pretty significant changes underneath the hood.
Let me know what you think.