]> granicus.if.org Git - python/commitdiff
Skip test_curses if stdin is not a tty (like when run from cron or buildbot). Will...
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 5 Jan 2006 06:09:13 +0000 (06:09 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 5 Jan 2006 06:09:13 +0000 (06:09 +0000)
Lib/test/test_curses.py

index 67f3c571ad1325eb4d5e504df30fcb02f4e91877..7481642ea13d40d58f6f97cada639fe0d75aa3a6 100644 (file)
@@ -8,7 +8,7 @@
 # getmouse(), ungetmouse(), init_color()
 #
 
-import curses, sys, tempfile
+import curses, sys, tempfile, os
 
 # Optionally test curses module.  This currently requires that the
 # 'curses' resource be given on the regrtest command line using the -u
@@ -16,6 +16,8 @@ import curses, sys, tempfile
 
 from test import test_support
 test_support.requires('curses')
+if not os.isatty(sys.stdin.fileno()):
+    raise test_support.TestSkipped, "stdin is not a tty"
 
 def window_funcs(stdscr):
     "Test the methods of windows"