def METHOD_NAME(mocked_log_and_exit):
    exc = ValueError('another test')
    with error_handler.error_handler():
        raise exc
    mocked_log_and_exit.assert_called_once_with(
        'An unexpected error has occurred',
        3,
        exc,
        # Tested below
        mock.ANY,
    )
    pattern = re_assert.Matches(
        r'Traceback \(most recent call last\):\n'
        r'  File ".+pre_commit.error_handler.py", line \d+, in error_handler\n'
        r'    yield\n'
        r'(    \^\^\^\^\^\n)?'
        r'  File ".+tests.error_handler_test.py", line \d+, '
        r'in test_error_handler_uncaught_error\n'
        r'    raise exc\n'
        r'(    \^\^\^\^\^\^\^\^\^\n)?'
        r'ValueError: another test\n',
    )
    pattern.assert_matches(mocked_log_and_exit.call_args[0][3])