1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-10 01:25:34 +00:00

Add force reset around calls to actual connection from stubs, to ensure

compatibility with version of httplib/urlib2 in python 2.7.9. Closes #130.
This commit is contained in:
Ivan Malison
2014-12-26 05:07:02 -05:00
parent 5301149bd8
commit e1f65bcbdc

View File

@@ -236,12 +236,16 @@ class VCRConnection(object):
self._vcr_request self._vcr_request
) )
) )
self.real_connection.request( # This is imported here to avoid circular import.
method=self._vcr_request.method, # TODO(@IvanMalison): Refactor to allow normal import.
url=self._url(self._vcr_request.uri), from vcr.patch import force_reset
body=self._vcr_request.body, with force_reset():
headers=self._vcr_request.headers, self.real_connection.request(
) method=self._vcr_request.method,
url=self._url(self._vcr_request.uri),
body=self._vcr_request.body,
headers=self._vcr_request.headers,
)
# get the response # get the response
response = self.real_connection.getresponse() response = self.real_connection.getresponse()