~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/test/test_curses.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from test.test_support import requires, TestSkipped
20
20
requires('curses')
21
21
 
 
22
# skip all these tests on FreeBSD: test_curses currently hangs the
 
23
# FreeBSD buildbots, preventing other tests from running.  See issue
 
24
# #7384.
 
25
if 'freebsd' in sys.platform:
 
26
    raise unittest.SkipTest('The curses module is broken on FreeBSD.  See http://bugs.python.org/issue7384.')
 
27
 
22
28
# XXX: if newterm was supported we could use it instead of initscr and not exit
23
29
term = os.environ.get('TERM')
24
30
if not term or term == 'unknown':
255
261
        if curses.LINES != lines - 1 or curses.COLS != cols + 1:
256
262
            raise RuntimeError, "Expected resizeterm to update LINES and COLS"
257
263
 
 
264
def test_issue6243(stdscr):
 
265
    curses.ungetch(1025)
 
266
    stdscr.getkey()
 
267
 
258
268
def main(stdscr):
259
269
    curses.savetty()
260
270
    try:
262
272
        window_funcs(stdscr)
263
273
        test_userptr_without_set(stdscr)
264
274
        test_resize_term(stdscr)
 
275
        test_issue6243(stdscr)
265
276
    finally:
266
277
        curses.resetty()
267
278
 
269
280
    curses.wrapper(main)
270
281
    unit_tests()
271
282
else:
 
283
    if not sys.__stdout__.isatty():
 
284
        raise TestSkipped("sys.__stdout__ is not a tty")
272
285
    # testing setupterm() inside initscr/endwin
273
286
    # causes terminal breakage
274
287
    curses.setupterm(fd=sys.__stdout__.fileno())