summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:51:52 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:51:52 +0100
commit67b2aa8b9fe4c969f3e46b8a206a4f706806e19e (patch)
tree541a45ca5224603ee50b332f9a26e4954c16a855 /tests/unittest.py
parentMerge commit 'cc324d53f' into anoa/dinsic_release_1_31_0 (diff)
parentfederation_client: handle inline signing_keys in hs.yaml (#9647) (diff)
downloadsynapse-67b2aa8b9fe4c969f3e46b8a206a4f706806e19e.tar.xz
Merge commit '0e3558473' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 224f037ce1..58a4daa1ec 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -32,6 +32,7 @@ from twisted.python.threadpool import ThreadPool from twisted.trial import unittest from twisted.web.resource import Resource +from synapse import events from synapse.api.constants import EventTypes, Membership from synapse.config.homeserver import HomeServerConfig from synapse.config.ratelimiting import FederationRateLimitConfig @@ -229,6 +230,11 @@ class HomeserverTestCase(TestCase): self._hs_args = {"clock": self.clock, "reactor": self.reactor} self.hs = self.make_homeserver(self.reactor, self.clock) + # Honour the `use_frozen_dicts` config option. We have to do this + # manually because this is taken care of in the app `start` code, which + # we don't run. Plus we want to reset it on tearDown. + events.USE_FROZEN_DICTS = self.hs.config.use_frozen_dicts + if self.hs is None: raise Exception("No homeserver returned from make_homeserver.") @@ -292,6 +298,10 @@ class HomeserverTestCase(TestCase): if hasattr(self, "prepare"): self.prepare(self.reactor, self.clock, self.hs) + def tearDown(self): + # Reset to not use frozen dicts. + events.USE_FROZEN_DICTS = False + def wait_on_thread(self, deferred, timeout=10): """ Wait until a Deferred is done, where it's waiting on a real thread.