summaryrefslogtreecommitdiff
path: root/Lib/test/test_curses.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_curses.py')
-rw-r--r--Lib/test/test_curses.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 7481642ea1..e137d318a8 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -14,10 +14,13 @@ import curses, sys, tempfile, os
# 'curses' resource be given on the regrtest command line using the -u
# option. If not available, nothing after this line will be executed.
-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"
+from test.test_support import requires, TestSkipped
+requires('curses')
+
+# XXX: if newterm was supported we could use it instead of initscr and not exit
+term = os.environ.get('TERM')
+if not term or term == 'unknown':
+ raise TestSkipped, "$TERM=%r, calling initscr() may cause exit" % term
def window_funcs(stdscr):
"Test the methods of windows"