8000 bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on th… · Ringdingcoder/cpython@87f7ab5 · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"87f7ab5359bc12eeb858272b7bd58e132cb9c176","url":"/Ringdingcoder/cpython/commit/87f7ab5359bc12eeb858272b7bd58e132cb9c176","authoredDate":"2020-11-25T19:06:12.000+02:00","committedDate":"2020-11-25T19:06:12.000+02:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003ebpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform (\u003ca class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"750896563\" data-permission-text=\"Title is private\" data-url=\"https://github.com/python/cpython/issues/23514\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/python/cpython/pull/23514/hovercard\" href=\"https://github.com/python/cpython/pull/23514\"\u003epythonGH-23514\u003c/a\u003e)\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"","authors":[{"login":"asvetlov","displayName":"Andrew Svetlov","avatarUrl":"https://avatars.githubusercontent.com/u/356399?v=4","path":"/asvetlov","isGitHub":false}],"committerAttribution":false,"committer":{"login":"web-flow","displayName":"GitHub","avatarUrl":"https://avatars.githubusercontent.com/u/19864447?v=4","path":"/web-flow","isGitHub":true},"parents":["9d09e1719ce9dea1c97f06dd5f181daed928d6cd"],"globalRelayId":"MDY6Q29tbWl0MzE2NTE1OTI2Ojg3ZjdhYjUzNTliYzEyZWViODU4MjcyYjdiZDU4ZTEzMmNiOWMxNzY=","sha1":"9d09e1719ce9dea1c97f06dd5f181daed928d6cd","sha2":"87f7ab5359bc12eeb858272b7bd58e132cb9c176"},"currentUser":null,"repo":{"id":316515926,"defaultBranch":"master","name":"cpython","ownerLogin":"Ringdingcoder","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2020-11-27T13:58:33.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/173088?v=4","public":true,"private":false,"isOrgOwned":false},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":4,"text":"@@ -5,6 +5,7 @@","html":"@@ -5,6 +5,7 @@","displayNoNewLineWarning":false,"position":0,"left":4,"right":4},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":5,"text":" import_module('termios')","html":" \u003cspan class=pl-en\u003eimport_module\u003c/span\u003e(\u003cspan class=pl-s\u003e\u0026#39;termios\u0026#39;\u003c/span\u003e)","displayNoNewLineWarning":false,"position":1,"left":5,"right":5},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":6,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":2,"left":6,"right":6},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":7,"text":" import errno","html":" \u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-s1\u003eerrno\u003c/span\u003e","displayNoNewLineWarning":false,"position":3,"left":7,"right":7},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":8,"text":"+import pathlib","html":"+\u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-s1\u003epathlib\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":7,"right":8},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":9,"text":" import pty","html":" \u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-s1\u003epty\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":8,"right":9},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":10,"text":" import os","html":" \u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-s1\u003eos\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":9,"right":10},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":11,"text":" import sys","html":" \u003cspan class=pl-k\u003eimport\u003c/span\u003e \u003cspan class=pl-s1\u003esys\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":10,"right":11},{"stylingDirective":null,"type":"HUNK","blobLineNumber":75,"text":"@@ -75,6 +76,19 @@ def _readline(fd):","html":"@@ -75,6 +76,19 @@ def _readline(fd):","displayNoNewLineWarning":false,"position":8,"left":74,"right":75},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":76,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":9,"left":75,"right":76},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":77,"text":" def expectedFailureIfStdinIsTTY(fun):","html":" \u003cspan class=pl-k\u003edef\u003c/span\u003e \u003cspan class=pl-en\u003eexpectedFailureIfStdinIsTTY\u003c/span\u003e(\u003cspan class=pl-s1\u003efun\u003c/span\u003e):","displayNoNewLineWarning":false,"position":10,"left":76,"right":77},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":78,"text":" # avoid isatty() for now","html":" \u003cspan class=pl-c\u003e# avoid isatty() for now\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":77,"right":78},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":79,"text":"+ PLATFORM = platform.system()","html":"+ \u003cspan class=pl-c1\u003ePLATFORM\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003eplatform\u003c/span\u003e.\u003cspan class=pl-c1\u003esystem\u003c/span\u003e()","displayNoNewLineWarning":false,"position":12,"left":77,"right":79},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":80,"text":"+ if PLATFORM == \"Linux\":","html":"+ \u003cspan class=pl-k\u003eif\u003c/span\u003e \u003cspan class=pl-c1\u003ePLATFORM\u003c/span\u003e \u003cspan class=pl-c1\u003e==\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026quot;Linux\u0026quot;\u003c/span\u003e:","displayNoNewLineWarning":false,"position":13,"left":77,"right":80},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":81,"text":"+ os_release = pathlib.Path(\"/etc/os-release\")","html":"+ \u003cspan class=pl-s1\u003eos_release\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003epathlib\u003c/span\u003e.\u003cspan class=pl-c1\u003ePath\u003c/span\u003e(\u003cspan class=pl-s\u003e\u0026quot;/etc/os-release\u0026quot;\u003c/span\u003e)","displayNoNewLineWarning":false,"position":14,"left":77,"right":81},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":82,"text":"+ if os_release.exists():","html":"+ \u003cspan class=pl-k\u003eif\u003c/span\u003e \u003cspan class=pl-s1\u003eos_release\u003c/span\u003e.\u003cspan class=pl-c1\u003eexists\u003c/span\u003e():","displayNoNewLineWarning":false,"position":15,"left":77,"right":82},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":83,"text":"+ # Actually the file has complex multi-line structure,","html":"+ \u003cspan class=pl-c\u003e# Actually the file has complex multi-line structure,\u003c/span\u003e","displayNoNewLineWarning":false,"position":16,"left":77,"right":83},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":84,"text":"+ # these is no need to parse it for Gentoo check","html":"+ \u003cspan class=pl-c\u003e# these is no need to parse it for Gentoo check\u003c/span\u003e","displayNoNewLineWarning":false,"position":17,"left":77,"right":84},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":85,"text":"+ if 'gentoo' in os_release.read_text().lower():","html":"+ \u003cspan class=pl-k\u003eif\u003c/span\u003e \u003cspan class=pl-s\u003e\u0026#39;gentoo\u0026#39;\u003c/span\u003e \u003cspan class=pl-c1\u003ein\u003c/span\u003e \u003cspan class=pl-s1\u003eos_release\u003c/span\u003e.\u003cspan class=pl-c1\u003eread_text\u003c/span\u003e().\u003cspan class=pl-c1\u003elower\u003c/span\u003e():","displayNoNewLineWarning":false,"position":18,"left":77,"right":85},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":86,"text":"+ # bpo-41818:","html":"+ \u003cspan class=pl-c\u003e# bpo-41818:\u003c/span\u003e","displayNoNewLineWarning":false,"position":19,"left":77,"right":86},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":87,"text":"+ # Gentoo passes the test,","html":"+ \u003cspan class=pl-c\u003e# Gentoo passes the test,\u003c/span\u003e","displayNoNewLineWarning":false,"position":20,"left":77,"right":87},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":88,"text":"+ # all other tested Linux distributions fail.","html":"+ \u003cspan class=pl-c\u003e# all other tested Linux distributions fail.\u003c/span\u003e","displayNoNewLineWarning":false,"position":21,"left":77,"right":88},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":89,"text":"+ # Should not apply @unittest.expectedFailure() on Gentoo","html":"+ \u003cspan class=pl-c\u003e# Should not apply @unittest.expectedFailure() on Gentoo\u003c/span\u003e","displayNoNewLineWarning":false,"position":22,"left":77,"right":89},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":90,"text":"+ # to keep the buildbot fleet happy.","html":"+ \u003cspan class=pl-c\u003e# to keep the buildbot fleet happy.\u003c/span\u003e","displayNoNewLineWarning":false,"position":23,"left":77,"right":90},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":91,"text":"+ return fun","html":"+ \u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003efun\u003c/span\u003e","displayNoNewLineWarning":false,"position":24,"left":77,"right":91},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":92,"text":" try:","html":" \u003cspan class=pl-k\u003etry\u003c/span\u003e:","displayNoNewLineWarning":false,"position":25,"left":78,"right":92},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":93,"text":" tty.tcgetattr(pty.STDIN_FILENO)","html":" \u003cspan class=pl-s1\u003etty\u003c/span\u003e.\u003cspan class=pl-c1\u003etcgetattr\u003c/span\u003e(\u003cspan class=pl-s1\u003epty\u003c/span\u003e.\u003cspan class=pl-c1\u003eSTDIN_FILENO\u003c/span\u003e)","displayNoNewLineWarning":false,"position":26,"left":79,"right":93},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":94,"text":" return unittest.expectedFailure(fun)","html":" \u003cspan class=pl-k\u003ereturn\u003c/span\u003e \u003cspan class=pl-s1\u003eunittest\u003c/span\u003e.\u003cspan class=pl-c1\u003eexpectedFailure\u003c/span\u003e(\u003cspan class=pl-s1\u003efun\u003c/span\u003e)","displayNoNewLineWarning":false,"position":27,"left":80,"right":94}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":440,"linesChanged":14,"newTreeEntry":{"lineCount":440,"path":"Lib/test/test_pty.py","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"Lib/test/test_pty.py","mode":100644},"linesAdded":14,"linesDeleted":0,"path":"Lib/test/test_pty.py","pathDigest":"818ac3490d7146a2dcd2d9add58f5e8f12cc3c1fe752d4e5eb7986852f6bb80d","status":"MODIFIED","truncatedReason":null,"oldOid":"9d09e1719ce9dea1c97f06dd5f181daed928d6cd","newOid":"87f7ab5359bc12eeb858272b7bd58e132cb9c176","copilotChatReference":null,"deletedSha":"9d09e1719ce9dea1c97f06dd5f181daed928d6cd","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDQ6VXNlcjE3MzA4OA==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/Ringdingcoder/cpython/commit/87f7ab5359bc12eeb858272b7bd58e132cb9c176","fileTreeExpanded":true,"headerInfo":{"additions":14,"deletions":0,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":942,"lineShownCount":28},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"kSpLMbQEWWWowv4r5ahnVO3ft7uEJjwX_LFolIzodD3BkSPScQ--U3UpLcPi9bZq_5NNAB1QjiPT1bD25Xf9CQ"},"/users/diffview?diff=unified":{"post":"meJGmNp91RFEKLiJKVKiqQslaIJxKeiS8WKcr0b5CxDJWS57H3YyJ5nDa2EuD3OXGWmSOehfWqbeBkTNL2aCJA"},"/notifications/thread":{"post":"SRMOctZFnP8IhsEMNWM88oBb5OjXmmVLDq4_a73GVTe8PDWSdyIVz-7VasErb3AqTPoO4uCifHYnBxkHIvQStg"}}},"title":"bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on th… · Ringdingcoder/cpython@87f7ab5","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-f6b2312e7da9.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":false}}}

Commit 87f7ab5

Browse files
authored
bpo-41818: test_openpty succeed on Gentoo, don't expect to fail on this platform (pythonGH-23514)
1 parent 9d09e17 commit 87f7ab5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lib/test/test_pty.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import_module('termios')
66

77
import errno
8+
import pathlib
89
import pty
910
import os
1011
import sys
@@ -75,6 +76,19 @@ def _readline(fd):
7576

7677
def expectedFailureIfStdinIsTTY(fun):
7778
# avoid isatty() for now
79+
PLATFORM = platform.system()
80+
if PLATFORM == "Linux":
81+
os_release = pathlib.Path("/etc/os-release")
82+
if os_release.exists():
83+
# Actually the file has complex multi-line structure,
84+
# these is no need to parse it for Gentoo check
85+
if 'gentoo' in os_release.read_text().lower():
86+
# bpo-41818:
87+
# Gentoo passes the test,
88+
# all other tested Linux distributions fail.
89+
# Should not apply @unittest.expectedFailure() on Gentoo
90+
# to keep the buildbot fleet happy.
91+
return fun
7892
try:
7993
tty.tcgetattr(pty.STDIN_FILENO)
8094
return unittest.expectedFailure(fun)

0 commit comments

Comments
 (0)
0