def test_dispatch_exception(self, loop, evt):
        logger = mock.Mock(Logger)
        dispatcher = event.EventDispatcher(logger=logger)
        called = 0

        @event.event(evt.name)
        async def corofunc():
            nonlocal called
            called += 1
            raise ValueError("yeah async")

        @event.event(evt.name)
        def handler():
            nonlocal called
            called += 1
            raise ValueError("yeah sync")

        dispatcher.register(event.HandlerInstance.from_handler(corofunc))
        dispatcher.register(event.HandlerInstance.from_handler(handler))
        assert not logger.exception.called
        loop.run_until_complete(dispatcher.dispatch(evt))
        assert called == 2
        assert logger.exception.call_count == 2