

def _expect_exact(context, expected, timeout):
    try:
        context.cli.expect_exact(expected, timeout=timeout)
    except:
        actual = re.sub('\\x1b\\[([0-9A-Za-z;?])+[m|K]?', '', context.cli.before)
        raise Exception('Expected:\n---\n{0}\n---\n\nActual:\n---\n{1}\n---'.format(expected, actual))

dataset/ETHPy150Open dbcli/pgcli/tests/features/steps/step_definitions.py _expect_exact/original