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

Use mock for patching http connection objects.

This commit is contained in:
Ivan Malison
2014-09-18 05:32:55 -07:00
parent 9a564586a4
commit 958aac3af3
6 changed files with 138 additions and 112 deletions

View File

@@ -295,10 +295,9 @@ class VCRConnection:
# need to temporarily reset here because the real connection
# inherits from the thing that we are mocking out. Take out
# the reset if you want to see what I mean :)
from vcr.patch import install, reset
reset()
self.real_connection = self._baseclass(*args, **kwargs)
install(self.cassette)
from vcr.patch import force_reset
with force_reset():
self.real_connection = self._baseclass(*args, **kwargs)
class VCRHTTPConnection(VCRConnection):