summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pty.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2020-11-25 17:06:12 (GMT)
committerGitHub <noreply@github.com>2020-11-25 17:06:12 (GMT)
commit87f7ab5359bc12eeb858272b7bd58e132cb9c176 (patch)
tree1e9dad4de0bbad5c9348da7b18ee8e23f438d679 /Lib/test/test_pty.py
parent9d09e1719ce9dea1c97f06dd5f181daed928d6cd (diff)
downloadcpython-87f7ab5359bc12eeb858272b7bd58e132cb9c176.zip
cpython-87f7ab5359bc12eeb858272b7bd58e132cb9c176.tar.gz
cpython-87f7ab5359bc12eeb858272b7bd58e132cb9c176.tar.bz2
bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform (GH-23514)
Diffstat (limited to 'Lib/test/test_pty.py')
-rw-r--r--Lib/test/test_pty.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index 7de5688..138560e 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -5,6 +5,7 @@ from test.support.import_helper import import_module
import_module('termios')
import errno
+import pathlib
import pty
import os
import sys
@@ -75,6 +76,19 @@ def _readline(fd):
def expectedFailureIfStdinIsTTY(fun):
# avoid isatty() for now
+ PLATFORM = platform.system()
+ if PLATFORM == "Linux":
+ os_release = pathlib.Path("/etc/os-release")
+ if os_release.exists():
+ # Actually the file has complex multi-line structure,
+ # these is no need to parse it for Gentoo check
+ if 'gentoo' in os_release.read_text().lower():
+ # bpo-41818:
+ # Gentoo passes the test,
+ # all other tested Linux distributions fail.
+ # Should not apply @unittest.expectedFailure() on Gentoo
+ # to keep the buildbot fleet happy.
+ return fun
try:
tty.tcgetattr(pty.STDIN_FILENO)
return unittest.expectedFailure(fun)