https://github.com/python/cpython/commit/9bf69659e178d3fbd6996ec8beba563a843bbf6e
commit: 9bf69659e178d3fbd6996ec8beba563a843bbf6e
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2025-10-02T18:10:36+02:00
summary:

gh-55258: Reenable support test_get_original_stdout() (#139499)

files:
M Lib/test/test_support.py

diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 711691348ffe7c..92909519636cf3 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -96,9 +96,13 @@ def test_get_attribute(self):
                         self.test_get_attribute)
         self.assertRaises(unittest.SkipTest, support.get_attribute, self, 
"foo")
 
-    @unittest.skip("failing buildbots")
     def test_get_original_stdout(self):
-        self.assertEqual(support.get_original_stdout(), sys.stdout)
+        if isinstance(sys.stdout, io.StringIO):
+            # gh-55258: When --junit-xml is used, stdout is a StringIO:
+            # use sys.__stdout__ in this case.
+            self.assertEqual(support.get_original_stdout(), sys.__stdout__)
+        else:
+            self.assertEqual(support.get_original_stdout(), sys.stdout)
 
     def test_unload(self):
         import sched  # noqa: F401

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to