From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 6 Jan 2026 14:49:43 +0000 (+0100) Subject: [3.14] gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d52ea8978316c68c105e95a8b89cd7a210b8b57;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461) (GH-143466) (cherry picked from commit 7dae1077cd18c1ddc50b130335936bc71e1c4ccd) Co-authored-by: Ɓukasz Langa --- diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 9c365007bebc..add987ee3d19 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -2002,6 +2002,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.