From 1ce4b14c4d8a5b5ff8de7d1a4aabf053d550d7d1 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 6 Nov 2011 03:03:18 +0100 Subject: [PATCH] Skip early if stdin and stdout are not ttys --- Lib/test/test_builtin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 244e55ffb53..55fb63ae3f5 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -996,6 +996,8 @@ class BuiltinTest(unittest.TestCase): @unittest.skipUnless(pty, "the pty and signal modules must be available") def check_input_tty(self, prompt, terminal_input, stdio_encoding=None): + if not sys.stdin.isatty() or not sys.stdout.isatty(): + self.skipTest("stdin and stdout must be ttys") r, w = os.pipe() try: pid, fd = pty.fork()