(self)
| 183 | |
| 184 | @gen_test |
| 185 | def test_multi_exceptions(self): |
| 186 | with ExpectLog(app_log, "Multiple exceptions in yield list"): |
| 187 | with self.assertRaises(RuntimeError) as cm: |
| 188 | yield gen.Multi( |
| 189 | [ |
| 190 | self.async_exception(RuntimeError("error 1")), |
| 191 | self.async_exception(RuntimeError("error 2")), |
| 192 | ] |
| 193 | ) |
| 194 | self.assertEqual(str(cm.exception), "error 1") |
| 195 | |
| 196 | # With only one exception, no error is logged. |
| 197 | with self.assertRaises(RuntimeError): |
| 198 | yield gen.Multi( |
| 199 | [self.async_exception(RuntimeError("error 1")), self.async_future(2)] |
| 200 | ) |
| 201 | |
| 202 | # Exception logging may be explicitly quieted. |
| 203 | with self.assertRaises(RuntimeError): |
| 204 | yield gen.Multi( |
| 205 | [ |
| 206 | self.async_exception(RuntimeError("error 1")), |
| 207 | self.async_exception(RuntimeError("error 2")), |
| 208 | ], |
| 209 | quiet_exceptions=RuntimeError, |
| 210 | ) |
| 211 | |
| 212 | @gen_test |
| 213 | def test_multi_future_exceptions(self): |
nothing calls this directly
no test coverage detected