mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform (GH-23514)
This commit is contained in:
parent
9d09e1719c
commit
87f7ab5359
1 changed files with 14 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ from test.support.import_helper import import_module
|
||||||
import_module('termios')
|
import_module('termios')
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
|
import pathlib
|
||||||
import pty
|
import pty
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -75,6 +76,19 @@ def _readline(fd):
|
||||||
|
|
||||||
def expectedFailureIfStdinIsTTY(fun):
|
def expectedFailureIfStdinIsTTY(fun):
|
||||||
# avoid isatty() for now
|
# 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:
|
try:
|
||||||
tty.tcgetattr(pty.STDIN_FILENO)
|
tty.tcgetattr(pty.STDIN_FILENO)
|
||||||
return unittest.expectedFailure(fun)
|
return unittest.expectedFailure(fun)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue