Closed hroncok closed 8 years ago
Would thet be possible?
I don't know how to do that, but it might be possible. If you can research that and send a pull request, I would happily review it.
For the record: Here's how the name is determined in betamax's code: https://github.com/sigmavirus24/betamax/blob/492116a368b5682ccd68e93b85414d47f51556e0/betamax/fixtures/pytest.py#L41
And that line shall be replaced with:
cassette_name += request.node.name
I can do that as PR, but this as a change that breaks backwards compatibility. Any idea how to handle that nicely?
The permanent link for future viewers of this issue is https://github.com/sigmavirus24/betamax/blob/492116a368b5682ccd68e93b85414d47f51556e0/betamax/fixtures/pytest.py#L41
Any idea how to handle that nicely?
Have a second fixture for parameterized tests (e.g., betamax_parameterized_session
and have both use the warnings module to indicate that betamax 1.0.0 will change the behaviour of betamax_session
and remove betamax_parameterized_session
.
First draft is in #113, however this will be problematic with unprintable or path-specific characters like \n
or /
. So I need to come up with some sanitizing function that would make it good file name.
Consider the following test:
I would like this to work with simple URL and METHOD matchers, but unfortunatelly not, becouse the name of the cassette does not contian any parameters, and will simply be ...test_upload_file.json.
It would be awesome if the cassette name could somehow contain the arguments for parameters, such as in this case ...test_upload_file[foo.txt].json. Would thet be possible? Thanks