summaryrefslogtreecommitdiffstats
path: root/tests/features/steps/wrappers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features/steps/wrappers.py')
-rw-r--r--tests/features/steps/wrappers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/features/steps/wrappers.py b/tests/features/steps/wrappers.py
index de49cede..9a7f89da 100644
--- a/tests/features/steps/wrappers.py
+++ b/tests/features/steps/wrappers.py
@@ -3,6 +3,7 @@ from __future__ import unicode_literals
import re
import pexpect
+from pgcli.main import COLOR_CODE_REGEX
def expect_exact(context, expected, timeout):
@@ -10,7 +11,7 @@ def expect_exact(context, expected, timeout):
context.cli.expect_exact(expected, timeout=timeout)
except:
# Strip color codes out of the output.
- actual = re.sub(r'\x1b\[([0-9A-Za-z;?])+[m|K]?', '', context.cli.before)
+ actual = COLOR_CODE_REGEX.sub('', context.cli.before)
raise Exception('Expected:\n---\n{0!r}\n---\n\nActual:\n---\n{1!r}\n---'.format(
expected,
actual))