diff --git a/vcr/cassette.py b/vcr/cassette.py index 1b8b1f2a..a8e0c923 100644 --- a/vcr/cassette.py +++ b/vcr/cassette.py @@ -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): @@ -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): """ @@ -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