Index: Lib/test/test_ioctl.py =================================================================== --- Lib/test/test_ioctl.py (revision 77754) +++ Lib/test/test_ioctl.py (working copy) @@ -24,7 +24,10 @@ tty = open("/dev/tty", "r") r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ") rpgrp = struct.unpack("i", r)[0] - self.assertIn(rpgrp, ids) + if not rpgrp in ids: + # Do not fail if another process is in foreground + raise self.skipTest("process group %s is associated " + "with /dev/tty" % rpgrp) def test_ioctl_mutate(self): import array @@ -34,7 +37,9 @@ r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1) rpgrp = buf[0] self.assertEquals(r, 0) - self.assertIn(rpgrp, ids) + if not rpgrp in ids: + raise self.skipTest("process group %s is associated " + "with /dev/tty" % rpgrp) def test_ioctl_signed_unsigned_code_param(self): if not pty: