Browse Source

tests: disable asyncio debug mode

see https://bugs.python.org/issue38608
master
SomberNight 3 years ago
parent
commit
7aa1609718
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/tests/__init__.py

7
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()

Loading…
Cancel
Save