silence expected exception

This commit is contained in:
Lex Berezhny 2020-06-09 23:27:45 -04:00
parent ae8bc59c65
commit 096f74d79b

View file

@ -31,7 +31,7 @@ class StreamControllerTestCase(AsyncioTestCase):
raise ValueError('bad') raise ValueError('bad')
controller = EventController() controller = EventController()
controller.stream.listen(bad_listener) controller.stream.listen(bad_listener)
with self.assertRaises(ValueError): with self.assertRaises(ValueError), self.assertLogs():
await controller.add("yo") await controller.add("yo")
async def test_async_listener_errors(self): async def test_async_listener_errors(self):
@ -39,7 +39,7 @@ class StreamControllerTestCase(AsyncioTestCase):
raise ValueError('bad') raise ValueError('bad')
controller = EventController() controller = EventController()
controller.stream.listen(bad_listener) controller.stream.listen(bad_listener)
with self.assertRaises(ValueError): with self.assertRaises(ValueError), self.assertLogs():
await controller.add("yo") await controller.add("yo")
async def test_first_event(self): async def test_first_event(self):