phabricator: do more of the VCR work in demandimport.deactivated()
If I don't do this, VCR gets confused looking for pycurl and other
libraries. I have no idea how this ever worked.
Differential Revision: https://phab.mercurial-scm.org/D5159
--- a/hgext/phabricator.py Fri Oct 19 11:28:29 2018 -0400
+++ b/hgext/phabricator.py Fri Oct 19 11:45:25 2018 -0400
@@ -131,14 +131,15 @@
with hgdemandimport.deactivated():
import vcr as vcrmod
import vcr.stubs as stubs
- vcr = vcrmod.VCR(
- serializer=r'json',
- custom_patches=[
- (urlmod, 'httpconnection', stubs.VCRHTTPConnection),
- (urlmod, 'httpsconnection', stubs.VCRHTTPSConnection),
- ])
- with vcr.use_cassette(cassette):
- return fn(*args, **kwargs)
+ vcr = vcrmod.VCR(
+ serializer=r'json',
+ custom_patches=[
+ (urlmod, 'httpconnection', stubs.VCRHTTPConnection),
+ (urlmod, 'httpsconnection',
+ stubs.VCRHTTPSConnection),
+ ])
+ with vcr.use_cassette(cassette):
+ return fn(*args, **kwargs)
return fn(*args, **kwargs)
inner.__name__ = fn.__name__
return command(name, fullflags, spec)(inner)