diff --git a/synapse/tests/test_common.py b/synapse/tests/test_common.py index 4aa0d2219f9..bf401bcc5bb 100644 --- a/synapse/tests/test_common.py +++ b/synapse/tests/test_common.py @@ -183,11 +183,11 @@ def test_common_chunks(self): parts = [chunk for chunk in s_common.chunks({1, 2, 3}, 10000)] # dict is unslicable - with self.assertRaises(TypeError) as cm: + with self.assertRaises((TypeError, KeyError)) as cm: parts = [chunk for chunk in s_common.chunks({1: 2}, 10000)] # empty dict is caught during the [0:0] slice - with self.assertRaises(TypeError) as cm: + with self.assertRaises((TypeError, KeyError)) as cm: parts = [chunk for chunk in s_common.chunks({}, 10000)] def test_common_ehex_uhex(self):