1
0

tests: interface: more aggressive clean-up

This commit is contained in:
SomberNight
2025-08-08 14:11:22 +00:00
parent cd8bbcd2bb
commit 98c4c9709f
2 changed files with 5 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ class MockNetwork:
self.proxy = None
self.debug = True
self.bhi_lock = asyncio.Lock()
self.interface = None # type: Interface | None
async def connection_down(self, interface: Interface):
pass
@@ -199,7 +200,10 @@ class TestInterface(ElectrumTestCase):
self.network = MockNetwork(config=self.config)
async def asyncTearDown(self):
if self.network.interface:
await self.network.interface.close()
self._server.close()
await self._server.wait_closed()
await super().asyncTearDown()
async def _start_iface_and_wait_for_sync(self):

View File

@@ -102,6 +102,7 @@ class TestLNTransport(ElectrumTestCase):
for t in transports:
t.close()
server.close()
await server.wait_closed()
await f()