mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Add Path handling to use_cassette and to filesystem.py persister
* now it is possible to use path from pathlib
This commit is contained in:
@@ -4,6 +4,7 @@ import inspect
|
||||
import os
|
||||
import types
|
||||
from collections import abc as collections_abc
|
||||
from pathlib import Path
|
||||
|
||||
import six
|
||||
|
||||
@@ -98,7 +99,7 @@ class VCR:
|
||||
return matchers
|
||||
|
||||
def use_cassette(self, path=None, **kwargs):
|
||||
if path is not None and not isinstance(path, str):
|
||||
if path is not None and not isinstance(path, (str, Path)):
|
||||
function = path
|
||||
# Assume this is an attempt to decorate a function
|
||||
return self._use_cassette(**kwargs)(function)
|
||||
|
||||
Reference in New Issue
Block a user