mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Merge pull request #451 from neozenith/master
fix IndexError when empty cassette throws CannotOverwriteCassetteException
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ build/
|
||||
dist/
|
||||
*.egg/
|
||||
.coverage
|
||||
htmlcov/
|
||||
*.egg-info/
|
||||
pytestdebug.log
|
||||
|
||||
|
||||
3
tox.ini
3
tox.ini
@@ -11,12 +11,13 @@ deps = flake8
|
||||
|
||||
[testenv]
|
||||
commands =
|
||||
./runtests.sh {posargs}
|
||||
./runtests.sh --cov={envsitepackagesdir}/vcr --cov-branch {posargs}
|
||||
deps =
|
||||
Flask
|
||||
mock
|
||||
pytest
|
||||
pytest-httpbin
|
||||
pytest-cov
|
||||
PyYAML
|
||||
ipaddress
|
||||
requests: requests>=2.22.0
|
||||
|
||||
@@ -311,6 +311,10 @@ class Cassette(object):
|
||||
best_matches.sort(key=lambda t: t[0], reverse=True)
|
||||
# Get the first best matches (multiple if equal matches)
|
||||
final_best_matches = []
|
||||
|
||||
if not best_matches:
|
||||
return final_best_matches
|
||||
|
||||
previous_nb_success = best_matches[0][0]
|
||||
for best_match in best_matches:
|
||||
nb_success = best_match[0]
|
||||
|
||||
Reference in New Issue
Block a user