Skip to content

Commit 805d997

Browse files
committed
Revert "Remove color handling of output; If CI fails might need to add back"
This reverts commit 9d03730.
1 parent bfcff38 commit 805d997

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_sqlite3/test_cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ def test_keyword_completion(self):
218218
# List candidates starting with 'S', there should be multiple matches.
219219
input = b"S\t\tEL\t 1;\n.quit\n"
220220
output = run_pty(script, input, env={"NO_COLOR": "1"})
221+
# Remove control sequences that colorize typed prefix 'S'
222+
output = re.sub(rb"\x1b\[[0-9;]*[mK]", b"", output)
221223
self.assertIn(b"SELECT", output)
222224
self.assertIn(b"SET", output)
223225
self.assertIn(b"SAVEPOINT", output)
@@ -234,13 +236,15 @@ def test_nothing_to_complete(self):
234236
script = "from sqlite3.__main__ import main; main()"
235237
input = b"zzzz\t;\n.quit\n"
236238
output = run_pty(script, input, env={"NO_COLOR": "1"})
239+
output = re.sub(rb"\x1b\[[0-9;]*[mK]", b"", output)
237240
for keyword in KEYWORDS:
238241
self.assertNotRegex(output, rf"\b{keyword}\b".encode("utf-8"))
239242

240243
def test_completion_order(self):
241244
script = "from sqlite3.__main__ import main; main()"
242245
input = b"S\t;\n.quit\n"
243246
output = run_pty(script, input, env={"NO_COLOR": "1"})
247+
output = re.sub(rb"\x1b\[[0-9;]*[mK]", b"", output).strip()
244248
savepoint_idx = output.find(b"SAVEPOINT")
245249
select_idx = output.find(b"SELECT")
246250
set_idx = output.find(b"SET")

0 commit comments

Comments
 (0)