]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well (GH-143461)
authorŁukasz Langa <lukasz@langa.pl>
Tue, 6 Jan 2026 10:10:18 +0000 (11:10 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 10:10:18 +0000 (11:10 +0100)
Lib/test/test_pyrepl/test_pyrepl.py

index 00dcbdc562ae64852fe17db39ef8a61bbcc47647..35a1733787e7a2f96cee999180e126b54541cc81 100644 (file)
@@ -2012,6 +2012,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.