mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
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>
This commit is contained in:
parent
e3aa2c0b75
commit
7d3f639844
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue