Be more robust.

This commit is contained in:
Itamar Turner-Trauring 2022-11-28 10:21:59 -05:00
parent 3ba166c2cb
commit aa80c9ef47

View File

@ -12,6 +12,7 @@ from cryptography import x509
from twisted.internet.endpoints import serverFromString
from twisted.internet import reactor
from twisted.internet.defer import maybeDeferred
from twisted.web.server import Site
from twisted.web.static import Data
from twisted.web.client import Agent, HTTPConnectionPool, ResponseNeverReceived
@ -88,8 +89,8 @@ class PinningHTTPSValidation(AsyncTestCase):
return AsyncTestCase.setUp(self)
def tearDown(self):
AsyncTestCase.tearDown(self)
return spin_until_cleanup_done()
d = maybeDeferred(AsyncTestCase.tearDown, self)
return d.addCallback(lambda _: spin_until_cleanup_done())
@asynccontextmanager
async def listen(self, private_key_path: FilePath, cert_path: FilePath):