Skip early if stdin and stdout are not ttys

This commit is contained in:
Antoine Pitrou 2011-11-06 03:04:12 +01:00
commit deb925fc14
1 changed files with 2 additions and 0 deletions

View File

@ -1008,6 +1008,8 @@ class BuiltinTest(unittest.TestCase):
@unittest.skipUnless(pty, "the pty and signal modules must be available") @unittest.skipUnless(pty, "the pty and signal modules must be available")
def check_input_tty(self, prompt, terminal_input, stdio_encoding=None): 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() r, w = os.pipe()
try: try:
pid, fd = pty.fork() pid, fd = pty.fork()