Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix record of new_episodes mode #755

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion vcr/cassette.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ def append(self, request, response):
response = self._before_record_response(response)
if response is None:
return

self.data.append((request, response))
self.play_counts[len(self.data) - 1] += 1

self.dirty = True

def filter_request(self, request):
Expand Down Expand Up @@ -294,6 +297,7 @@ def responses_of(self, request):

def rewind(self):
self.play_counts = collections.Counter()
self.rewound = True

def find_requests_with_most_matches(self, request):
"""
Expand Down Expand Up @@ -345,7 +349,7 @@ def _load(self):
for request, response in zip(requests, responses):
self.append(request, response)
self.dirty = False
self.rewound = True
self.rewind()
except (CassetteDecodeError, CassetteNotFoundError):
pass

Expand Down