tests: interface: more aggressive clean-up
This commit is contained in:
@@ -71,6 +71,7 @@ class MockNetwork:
|
|||||||
self.proxy = None
|
self.proxy = None
|
||||||
self.debug = True
|
self.debug = True
|
||||||
self.bhi_lock = asyncio.Lock()
|
self.bhi_lock = asyncio.Lock()
|
||||||
|
self.interface = None # type: Interface | None
|
||||||
|
|
||||||
async def connection_down(self, interface: Interface):
|
async def connection_down(self, interface: Interface):
|
||||||
pass
|
pass
|
||||||
@@ -199,7 +200,10 @@ class TestInterface(ElectrumTestCase):
|
|||||||
self.network = MockNetwork(config=self.config)
|
self.network = MockNetwork(config=self.config)
|
||||||
|
|
||||||
async def asyncTearDown(self):
|
async def asyncTearDown(self):
|
||||||
|
if self.network.interface:
|
||||||
|
await self.network.interface.close()
|
||||||
self._server.close()
|
self._server.close()
|
||||||
|
await self._server.wait_closed()
|
||||||
await super().asyncTearDown()
|
await super().asyncTearDown()
|
||||||
|
|
||||||
async def _start_iface_and_wait_for_sync(self):
|
async def _start_iface_and_wait_for_sync(self):
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ class TestLNTransport(ElectrumTestCase):
|
|||||||
for t in transports:
|
for t in transports:
|
||||||
t.close()
|
t.close()
|
||||||
server.close()
|
server.close()
|
||||||
|
await server.wait_closed()
|
||||||
|
|
||||||
await f()
|
await f()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user