From 7aa1609718661cd78011aba467673270e584eecc Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 20 Feb 2023 16:47:12 +0000 Subject: [PATCH] tests: disable asyncio debug mode see https://bugs.python.org/issue38608 --- electrum/tests/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/electrum/tests/__init__.py b/electrum/tests/__init__.py index ed26800ff..218a0db67 100644 --- a/electrum/tests/__init__.py +++ b/electrum/tests/__init__.py @@ -1,4 +1,5 @@ import asyncio +import os import unittest import threading import tempfile @@ -48,6 +49,12 @@ class ElectrumTestCase(unittest.IsolatedAsyncioTestCase): super().setUp() self.electrum_path = tempfile.mkdtemp() + async def asyncSetUp(self): + loop = util.get_asyncio_loop() + # IsolatedAsyncioTestCase creates event loops with debug=True, which makes the tests take ~4x time + if not (os.environ.get("PYTHONASYNCIODEBUG") or os.environ.get("PYTHONDEVMODE")): + loop.set_debug(False) + def tearDown(self): shutil.rmtree(self.electrum_path) super().tearDown()