summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-30 07:15:07 -0400
committerGitHub <noreply@github.com>2020-10-30 07:15:07 -0400
commitfd7c7434457e215d73873748604f430c52586498 (patch)
tree802dadad7c09fa86789b7392de90745d45da4186 /tests/unittest.py
parentFix race for concurrent downloads of remote media. (#8682) (diff)
downloadsynapse-fd7c7434457e215d73873748604f430c52586498.tar.xz
Fail test cases if they fail to await all awaitables (#8690)
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unittest.py b/tests/unittest.py
index 257f465897..08cf9b10c5 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -54,7 +54,7 @@ from tests.server import (
     render,
     setup_test_homeserver,
 )
-from tests.test_utils import event_injection
+from tests.test_utils import event_injection, setup_awaitable_errors
 from tests.test_utils.logging_setup import setup_logging
 from tests.utils import default_config, setupdb
 
@@ -119,6 +119,10 @@ class TestCase(unittest.TestCase):
 
                 logging.getLogger().setLevel(level)
 
+            # Trial messes with the warnings configuration, thus this has to be
+            # done in the context of an individual TestCase.
+            self.addCleanup(setup_awaitable_errors())
+
             return orig()
 
         @around(self)