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

only log message if response is appended

Closes: https://github.com/kevin1024/vcrpy/issues/685
This commit is contained in:
Matthias (~talfus-laddus)
2025-04-30 14:23:43 +02:00
committed by Jair Henrique
parent 952994b365
commit d5ba702a1b

View File

@@ -225,10 +225,10 @@ class Cassette:
def append(self, request, response):
"""Add a request, response pair to this cassette"""
log.info("Appending request %s and response %s", request, response)
request = self._before_record_request(request)
if not request:
return
log.info("Appending request %s and response %s", request, response)
# Deepcopy is here because mutation of `response` will corrupt the
# real response.
response = copy.deepcopy(response)