[Python-checkins] r41917 - python/trunk/Lib/test/test_curses.py

neal.norwitz python-checkins at python.org
Thu Jan 5 07:09:14 CET 2006


Author: neal.norwitz
Date: Thu Jan  5 07:09:13 2006
New Revision: 41917

Modified:
   python/trunk/Lib/test/test_curses.py
Log:
Skip test_curses if stdin is not a tty (like when run from cron or buildbot).  Will backport.

Modified: python/trunk/Lib/test/test_curses.py
==============================================================================
--- python/trunk/Lib/test/test_curses.py	(original)
+++ python/trunk/Lib/test/test_curses.py	Thu Jan  5 07:09:13 2006
@@ -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 @@
 
 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"


More information about the Python-checkins mailing list