'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Testing',
# -*- coding: utf-8 -*-
'''Integration tests with urllib2'''
+import ssl
from six.moves.urllib.request import urlopen
from six.moves.urllib_parse import urlencode
import pytest_httpbin.certs
def urlopen_with_cafile(*args, **kwargs):
- kwargs['cafile'] = pytest_httpbin.certs.where()
+ context = ssl.create_default_context(cafile=pytest_httpbin.certs.where())
+ context.check_hostname = False
+ kwargs['context'] = context
try:
return urlopen(*args, **kwargs)
except TypeError:
except Exception:
to_yield = coroutine.throw(*sys.exc_info())
else:
- to_yield = coroutine.send(to_send)
+ try:
+ to_yield = coroutine.send(to_send)
+ except StopIteration:
+ break
def _handle_function(self, fn):
with self as cassette: