1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-11 18:06:10 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Sebastian Pipping
ca4b1e19c2 Merge pull request #960 from kevin1024/precommit-autoupdate
pre-commit: Autoupdate
2025-12-08 18:02:12 +01:00
pre-commit
8d47ca10d0 pre-commit: Autoupdate 2025-12-05 16:06:35 +00:00
3 changed files with 2 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.6
rev: v0.14.8
hooks:
- id: ruff
args: ["--output-format=full"]

View File

@@ -310,13 +310,3 @@ def test_post_unicode_match_on_body(tmpdir, httpbin_both):
req2 = requests.post(url, data).content
assert req1 == req2
def test_duplicate_get_allow_playback_repeats(tmpdir, httpbin_both):
"""Ensure that duplicate requests are not included in the cassette on record."""
with vcr.use_cassette(str(tmpdir.join("allow_repeats.yaml")), allow_playback_repeats=True) as cass:
requests.get(httpbin_both + "/same")
requests.get(httpbin_both + "/different")
requests.get(httpbin_both + "/same")
assert len(cass) == 2

View File

@@ -253,12 +253,7 @@ class Cassette:
def can_play_response_for(self, request):
request = self._before_record_request(request)
return (
request
and request in self
and self.record_mode != RecordMode.ALL
and (self.rewound or self.allow_playback_repeats)
)
return request and request in self and self.record_mode != RecordMode.ALL and self.rewound
def play_response(self, request):
"""