mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b474c0510 |
@@ -22,9 +22,9 @@ def test_try_migrate_with_yaml(tmpdir):
|
||||
shutil.copy('tests/fixtures/migration/old_cassette.yaml', cassette)
|
||||
assert vcr.migration.try_migrate(cassette)
|
||||
with open('tests/fixtures/migration/new_cassette.yaml', 'r') as f:
|
||||
expected_yaml = yaml.load(f)
|
||||
expected_yaml = yaml.load(f, Loader=yaml.FullLoader)
|
||||
with open(cassette, 'r') as f:
|
||||
actual_yaml = yaml.load(f)
|
||||
actual_yaml = yaml.load(f, Loader=yaml.FullLoader)
|
||||
assert actual_yaml == expected_yaml
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import copy
|
||||
import collections
|
||||
import functools
|
||||
import inspect
|
||||
import os
|
||||
@@ -14,6 +13,11 @@ from .util import compose, auto_decorate
|
||||
from . import matchers
|
||||
from . import filters
|
||||
|
||||
try:
|
||||
from collections.abc import Iterable
|
||||
except ImportError:
|
||||
from collections import Iterable
|
||||
|
||||
|
||||
class VCR(object):
|
||||
|
||||
@@ -175,7 +179,7 @@ class VCR(object):
|
||||
if decode_compressed_response:
|
||||
filter_functions.append(filters.decode_response)
|
||||
if before_record_response:
|
||||
if not isinstance(before_record_response, collections.Iterable):
|
||||
if not isinstance(before_record_response, Iterable):
|
||||
before_record_response = (before_record_response,)
|
||||
filter_functions.extend(before_record_response)
|
||||
|
||||
@@ -241,7 +245,7 @@ class VCR(object):
|
||||
filter_functions.append(self._build_ignore_hosts(hosts_to_ignore))
|
||||
|
||||
if before_record_request:
|
||||
if not isinstance(before_record_request, collections.Iterable):
|
||||
if not isinstance(before_record_request, Iterable):
|
||||
before_record_request = (before_record_request,)
|
||||
filter_functions.extend(before_record_request)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user