1
0

tests: clean up event-loop creation

This commit is contained in:
SomberNight
2022-04-29 18:48:33 +02:00
parent 2c57c78ebe
commit 872ce82418
9 changed files with 7 additions and 58 deletions

View File

@@ -6,6 +6,7 @@ import shutil
import electrum
import electrum.logging
from electrum import constants
from electrum import util
# Set this locally to make the test suite run faster.
@@ -37,9 +38,12 @@ class ElectrumTestCase(SequentialTestCase):
def setUp(self):
super().setUp()
self.asyncio_loop, self._stop_loop, self._loop_thread = util.create_and_start_event_loop()
self.electrum_path = tempfile.mkdtemp()
def tearDown(self):
self.asyncio_loop.call_soon_threadsafe(self._stop_loop.set_result, 1)
self._loop_thread.join(timeout=1)
super().tearDown()
shutil.rmtree(self.electrum_path)