mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
This helps to figure out which matcher has decided your two cassettes differ, and figure out when your cassettes have hit the network. Closes #34
20 lines
452 B
Python
20 lines
452 B
Python
import logging
|
|
from .config import VCR
|
|
|
|
# Set default logging handler to avoid "No handler found" warnings.
|
|
import logging
|
|
try: # Python 2.7+
|
|
from logging import NullHandler
|
|
except ImportError:
|
|
class NullHandler(logging.Handler):
|
|
def emit(self, record):
|
|
pass
|
|
|
|
logging.getLogger(__name__).addHandler(NullHandler())
|
|
|
|
default_vcr = VCR()
|
|
|
|
|
|
def use_cassette(path, **kwargs):
|
|
return default_vcr.use_cassette(path, **kwargs)
|