Skip to content

Commit 9bf6965

Browse files
authored
pythongh-55258: Reenable support test_get_original_stdout() (python#139499)
1 parent ea4027e commit 9bf6965

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_support.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,13 @@ def test_get_attribute(self):
9696
self.test_get_attribute)
9797
self.assertRaises(unittest.SkipTest, support.get_attribute, self, "foo")
9898

99-
@unittest.skip("failing buildbots")
10099
def test_get_original_stdout(self):
101-
self.assertEqual(support.get_original_stdout(), sys.stdout)
100+
if isinstance(sys.stdout, io.StringIO):
101+
# gh-55258: When --junit-xml is used, stdout is a StringIO:
102+
# use sys.__stdout__ in this case.
103+
self.assertEqual(support.get_original_stdout(), sys.__stdout__)
104+
else:
105+
self.assertEqual(support.get_original_stdout(), sys.stdout)
102106

103107
def test_unload(self):
104108
import sched # noqa: F401

0 commit comments

Comments
 (0)