1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Add guard statement for empty Cassette when returning best match

fix white space flake 8 issue
This commit is contained in:
Josh Peak
2019-07-02 16:12:52 +10:00
parent 77581437f7
commit 9fb8a7b0ba

View File

@@ -311,7 +311,11 @@ 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 = []
previous_nb_success = 0
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]
# Do not keep matches that have 0 successes,