'This raises a failure inside of the try/except block of
bugdown.__init__.do_convert.'

@contextmanager
def simulated_markdown_failure(self):

    with self.settings(ERROR_BOT=None):
        with mock.patch('zerver.lib.bugdown.timeout', side_effect=KeyError('foo')):
            with mock.patch('zerver.lib.bugdown.log_bugdown_error'):
                (yield)
