##// END OF EJS Templates
py3: use fsencode for vcr recording paths and strings for custom_patches args...
Ian Moody -
r42064:2bad8f92 default
parent child Browse files
Show More
@@ -128,7 +128,7 b' def vcrcommand(name, flags, spec, helpca'
128 fullflags = flags + _VCR_FLAGS
128 fullflags = flags + _VCR_FLAGS
129 def decorate(fn):
129 def decorate(fn):
130 def inner(*args, **kwargs):
130 def inner(*args, **kwargs):
131 cassette = kwargs.pop(r'test_vcr', None)
131 cassette = pycompat.fsdecode(kwargs.pop(r'test_vcr', None))
132 if cassette:
132 if cassette:
133 import hgdemandimport
133 import hgdemandimport
134 with hgdemandimport.deactivated():
134 with hgdemandimport.deactivated():
@@ -137,8 +137,9 b' def vcrcommand(name, flags, spec, helpca'
137 vcr = vcrmod.VCR(
137 vcr = vcrmod.VCR(
138 serializer=r'json',
138 serializer=r'json',
139 custom_patches=[
139 custom_patches=[
140 (urlmod, 'httpconnection', stubs.VCRHTTPConnection),
140 (urlmod, r'httpconnection',
141 (urlmod, 'httpsconnection',
141 stubs.VCRHTTPConnection),
142 (urlmod, r'httpsconnection',
142 stubs.VCRHTTPSConnection),
143 stubs.VCRHTTPSConnection),
143 ])
144 ])
144 with vcr.use_cassette(cassette):
145 with vcr.use_cassette(cassette):
General Comments 0
You need to be logged in to leave comments. Login now