Skip early if stdin and stdout are not ttys

This commit is contained in:
Antoine Pitrou 2011-11-06 03:03:18 +01:00
parent 413d497247
commit 1ce4b14c4d
1 changed files with 2 additions and 0 deletions

View File

@ -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()