Skip to content

Commit 3d9721a

Browse files
committed
Dump output on error in verbose mode
1 parent bd6a870 commit 3d9721a

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Lib/test/test_sqlite3/test_cli.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
captured_stdin,
1717
force_not_colorized_test_class,
1818
requires_subprocess,
19+
verbose,
1920
)
2021

2122

@@ -289,15 +290,23 @@ def test_complete_no_input(self):
289290
""")
290291
input_ = b"\t\t.quit\n"
291292
output = run_pty(script, input_, env={**os.environ, "NO_COLOR": "1"})
292-
lines = output.decode().splitlines()
293-
indices = [
294-
i for i, line in enumerate(lines)
295-
if line.startswith(self.PS1)
296-
]
297-
self.assertEqual(len(indices), 2)
298-
start, end = indices
299-
candidates = [l.strip() for l in lines[start+1:end]]
300-
self.assertEqual(candidates, sorted(SQLITE_KEYWORDS))
293+
try:
294+
lines = output.decode().splitlines()
295+
indices = [
296+
i for i, line in enumerate(lines)
297+
if line.startswith(self.PS1)
298+
]
299+
self.assertEqual(len(indices), 3)
300+
start, end = indices
301+
candidates = [l.strip() for l in lines[start+1:end]]
302+
self.assertEqual(candidates, sorted(SQLITE_KEYWORDS))
303+
except:
304+
if verbose:
305+
print(' PTY output: '.center(30, '-'))
306+
print(output.decode(errors='replace'))
307+
print(' end PTY output '.center(30, '-'))
308+
raise
309+
301310

302311

303312
if __name__ == "__main__":

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy