diff options
author | Oleg Girko <ol@infoserver.lv> | 2018-09-24 16:51:59 +0100 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-09-25 02:51:18 +1000 |
commit | 7d3f639844f50061367db25cac0bd4d189648678 (patch) | |
tree | 4ccf054a2b2d9e8c944cc8ba1aabf92f2b9e326c | |
parent | towncrier (diff) | |
download | synapse-7d3f639844f50061367db25cac0bd4d189648678.tar.xz |
Fix compatibility issue with older Twisted in tests.
Older Twisted (18.4.0) returns TimeoutError instead of ConnectingCancelledError when connection times out. This change allows tests to be compatible with this behaviour. Signed-off-by: Oleg Girko <ol@infoserver.lv>
-rw-r--r-- | tests/http/test_fedclient.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/http/test_fedclient.py b/tests/http/test_fedclient.py index 1c46c9cfeb..d45d2bcb16 100644 --- a/tests/http/test_fedclient.py +++ b/tests/http/test_fedclient.py @@ -49,7 +49,7 @@ class FederationClientTests(HomeserverTestCase): def test_client_never_connect(self): """ If the HTTP request is not connected and is timed out, it'll give a - ConnectingCancelledError. + ConnectingCancelledError or TimeoutError. """ d = self.cl._request("testserv:8008", "GET", "foo/bar", timeout=10000) @@ -71,7 +71,7 @@ class FederationClientTests(HomeserverTestCase): self.reactor.advance(10.5) f = self.failureResultOf(d) - self.assertIsInstance(f.value, ConnectingCancelledError) + self.assertIsInstance(f.value, (ConnectingCancelledError, TimeoutError)) def test_client_connect_no_response(self): """ |