summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-01-28 12:08:39 (GMT)
committerThomas Wouters <thomas@python.org>2006-01-28 12:08:39 (GMT)
commitcb65c7ee19d6dfdbb47b15fcd8da16472b8100e0 (patch)
tree056189314b84685b196621535458871c577be797
parentf5eccd0ac4aa525cba17d8cfef66763277eb9932 (diff)
downloadcpython-cb65c7ee19d6dfdbb47b15fcd8da16472b8100e0.zip
cpython-cb65c7ee19d6dfdbb47b15fcd8da16472b8100e0.tar.gz
cpython-cb65c7ee19d6dfdbb47b15fcd8da16472b8100e0.tar.bz2
Work around a Solaris peculiarity that caused test_pty to sometimes fail: a
tty opened by os.openpty() isn't always a tty according to os.isatty(), when it's tested inside the process that opened it. Doesn't affect actual functionality, as using a tty this way is rarely, if ever, useful. Ignoring the failure allows the test for actual functionality to continue.
-rw-r--r--Lib/test/test_pty.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index 6bf9072..9fe038a 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -4,6 +4,13 @@ from test.test_support import verbose, TestFailed, TestSkipped
TEST_STRING_1 = "I wish to buy a fish license.\n"
TEST_STRING_2 = "For my pet fish, Eric.\n"
+# Solaris (at least 2.9 and 2.10) seem to have a ficke isatty(). The first
+# test below, testing the result of os.openpty() for tty-ness, sometimes
+# (but not always) fails. The second isatty test, in the sub-process, always
+# works. Allow that fickle first test to fail on these platforms, since it
+# doesn't actually affect functionality.
+fickle_isatty = ["sunos5"]
+
if verbose:
def debug(msg):
print msg
@@ -26,7 +33,7 @@ def test_basic_pty():
# " An optional feature could not be imported " ... ?
raise TestSkipped, "Pseudo-terminals (seemingly) not functional."
- if not os.isatty(slave_fd):
+ if not os.isatty(slave_fd) and sys.platform not in fickle_isatty:
raise TestFailed, "slave_fd is not a tty"
# IRIX apparently turns \n into \r\n. Allow that, but avoid allowing other