diff --git a/tests/integration/test_httplib2.py b/tests/integration/test_httplib2.py index 05a25d3..4eda032 100644 --- a/tests/integration/test_httplib2.py +++ b/tests/integration/test_httplib2.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- '''Integration tests with httplib2''' -# External imports +import sys + from six.moves.urllib_parse import urlencode import pytest import pytest_httpbin.certs -# Internal imports import vcr from assertions import assert_cassette_has_one_response @@ -19,7 +19,12 @@ def http(): Returns an httplib2 HTTP instance with the certificate replaced by the httpbin one. """ - return httplib2.Http(ca_certs=pytest_httpbin.certs.where()) + kwargs = { + 'ca_certs': pytest_httpbin.certs.where() + } + if sys.version_info[:2] == (3, 7): + kwargs['disable_ssl_certificate_validation'] = True + return httplib2.Http(**kwargs) def test_response_code(tmpdir, httpbin_both): diff --git a/vcr/stubs/httplib2_stubs.py b/vcr/stubs/httplib2_stubs.py index 4f31537..3d83406 100644 --- a/vcr/stubs/httplib2_stubs.py +++ b/vcr/stubs/httplib2_stubs.py @@ -40,6 +40,7 @@ class VCRHTTPSConnectionWithTimeout(VCRHTTPSConnection, 'timeout', 'source_address', 'ca_certs', + 'disable_ssl_certificate_validation', } unknown_keys = set(kwargs.keys()) - safe_keys safe_kwargs = kwargs.copy()