Skip to content

Commit de78e04

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
Clean up test output by removing ANSI escape sequences and non-printable characters
1 parent bc1e1b3 commit de78e04

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def test_lambda_in_REPL(): # noqa: N802
133133
after = buffer.getvalue()
134134
print(after) # noqa: T201
135135
print('------------') # noqa: T201
136+
after = re.compile(r'(?:\x1B[@-_]|\x9B)[0-?]*[ -/]*[@-~]').sub('', after.lstrip(before))
137+
after = ''.join(ch for ch in after if ch >= ' ' or ch in '\n\r\t')
138+
print(after) # noqa: T201
139+
print('------------') # noqa: T201
136140
after = after.lstrip(before)
137141
print(after) # noqa: T201
138142
print('------------') # noqa: T201

0 commit comments

Comments
 (0)