def METHOD_NAME(func=None, **kwargs):
    if func is None:
        # When called with kwargs, e.g. @use_vcr(inject_cassette=True)
        return functools.partial(METHOD_NAME, **kwargs)
    if 'path' not in kwargs:
        module = func.__module__.split('tests.')[-1].split('.')[-1]
        class_name = inspect.stack()[1][3]
        cassette_name = '.'.join([module, class_name, func.__name__])
        kwargs.setdefault('path', cassette_name)
    return test_vcr.use_cassette(**kwargs)(func)