##// END OF EJS Templates
Follow Fernando's suggestions.
Thomas Kluyver -
r4920:48ab7c9b
parent child
Show More
@@ -69,6 +69,11 def page_dumb(strng, start=0, screen_lines=25):
69 print >>io.stdout, last_escape + os.linesep.join(screens[-1])
69 print >>io.stdout, last_escape + os.linesep.join(screens[-1])
70
70
71 def _detect_screen_size(use_curses, screen_lines_def):
71 def _detect_screen_size(use_curses, screen_lines_def):
72 """Attempt to work out the number of lines on the screen.
73
74 This is called by page(). It can raise an error (e.g. when run in the
75 test suite), so it's separated out so it can easily be called in a try block.
76 """
72 if (TERM=='xterm' or TERM=='xterm-color') and sys.platform != 'sunos5':
77 if (TERM=='xterm' or TERM=='xterm-color') and sys.platform != 'sunos5':
73 local_use_curses = use_curses
78 local_use_curses = use_curses
74 else:
79 else:
@@ -325,6 +325,7 def check_pairs(func, pairs):
325 out = func(inp)
325 out = func(inp)
326 assert out == expected, pair_fail_msg.format(name, inp, expected, out)
326 assert out == expected, pair_fail_msg.format(name, inp, expected, out)
327
327
328
328 if py3compat.PY3:
329 if py3compat.PY3:
329 MyStringIO = StringIO
330 MyStringIO = StringIO
330 else:
331 else:
@@ -337,6 +338,7 else:
337
338
338 notprinted_msg = """Did not find {0!r} in printed output (on {1}):
339 notprinted_msg = """Did not find {0!r} in printed output (on {1}):
339 {2!r}"""
340 {2!r}"""
341
340 class AssertPrints(object):
342 class AssertPrints(object):
341 """Context manager for testing that code prints certain text.
343 """Context manager for testing that code prints certain text.
342
344
General Comments 0
You need to be logged in to leave comments. Login now