File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change 16
16
captured_stdin ,
17
17
force_not_colorized_test_class ,
18
18
requires_subprocess ,
19
+ verbose ,
19
20
)
20
21
21
22
@@ -289,15 +290,23 @@ def test_complete_no_input(self):
289
290
""" )
290
291
input_ = b"\t \t .quit\n "
291
292
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
+
301
310
302
311
303
312
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments