擅长:python、mysql、java
<p>现在,在较新版本的vcrpy中,通过完全省略磁带名来支持这一点。根据文件:</p>
<blockquote>
<p>VCR.py now allows the omission of the path argument to the use_cassette function. Both of the following are now legal/should work</p>
</blockquote>
<pre><code>@my_vcr.use_cassette
def my_test_function():
...
</code></pre>
<blockquote>
<p>In both cases, VCR.py will use a path that is generated from the provided test function’s name. If no
cassette_library_dir has been set, the cassette will be in a file with the name of the test function in directory
of the file in which the test function is declared. If a cassette_library_dir has been set, the cassette
will appear in that directory in a file with the name of the decorated function.</p>
<p>It is possible to control the path produced by the automatic naming machinery by customizing the
path_transformer and func_path_generator vcr variables</p>
</blockquote>