]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 6 Jan 2026 18:11:48 +0000 (19:11 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 18:11:48 +0000 (19:11 +0100)
(cherry picked from commit 7dae1077cd18c1ddc50b130335936bc71e1c4ccd)

Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Lib/test/test_pyrepl/test_pyrepl.py

index 6d80298dd24a46c1be9830599e44ddbea2c31aba..bfe7ceefc53cdc98e99a99119974509e4f6ddb7f 100644 (file)
@@ -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.