Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sslcontext.verify_mode = ssl.CERT_NONE
return sslcontext
@contextlib.contextmanager
def _silence_eof_received_warning(self):
# TODO This warning has to be fixed in asyncio.
logger = logging.getLogger('asyncio')
filter = logging.Filter('has no effect when using ssl')
logger.addFilter(filter)
try:
yield
finally:
logger.removeFilter(filter)
class UVTestCase(BaseTestCase):
implementation = 'uvloop'
def new_loop(self):
return uvloop.new_event_loop()
def new_policy(self):
return uvloop.EventLoopPolicy()
class AIOTestCase(BaseTestCase):
implementation = 'asyncio'
def setUp(self):
super().setUp()
finally:
logger.removeFilter(filter)
class UVTestCase(BaseTestCase):
implementation = 'uvloop'
def new_loop(self):
return uvloop.new_event_loop()
def new_policy(self):
return uvloop.EventLoopPolicy()
class AIOTestCase(BaseTestCase):
implementation = 'asyncio'
def setUp(self):
super().setUp()
watcher = asyncio.SafeChildWatcher()
watcher.attach_loop(self.loop)
asyncio.set_child_watcher(watcher)
def tearDown(self):
asyncio.set_child_watcher(None)
super().tearDown()
def new_loop(self):
return asyncio.new_event_loop()