From 2cd3b0ec911e6f6e8402172414997c4299f7eba0 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:11:48 +0100 Subject: [PATCH] [3.13] gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461) (GH-143467) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7dae1077cd18c1ddc50b130335936bc71e1c4ccd) Co-authored-by: Łukasz Langa --- Lib/test/test_pyrepl/test_pyrepl.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 6d80298dd24a..bfe7ceefc53c 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1486,6 +1486,17 @@ class TestMain(ReplTestCase): self.assertIn(expected_output_sequence, cleaned_output) +@skipUnless(sys.platform == "darwin", "macOS only") +class TestMainAppleTerminal(TestMain): + """Test the REPL with Apple Terminal's TERM_PROGRAM set.""" + + def run_repl(self, repl_input, env=None, **kwargs): + if env is None: + env = os.environ.copy() + env["TERM_PROGRAM"] = "Apple_Terminal" + return super().run_repl(repl_input, env=env, **kwargs) + + class TestPyReplCtrlD(TestCase): """Test Ctrl+D behavior in _pyrepl to match old pre-3.13 REPL behavior. -- 2.47.3