Skip to content

Commit 3d4281f

Browse files
committed
gh-143394: On macOS, run main PyREPL tests as "Apple Terminal" as well
1 parent 04ace41 commit 3d4281f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,17 @@ def test_no_newline(self):
20122012
self.assertIn(expected_output_sequence, cleaned_output)
20132013

20142014

2015+
@skipUnless(sys.platform == "darwin", "macOS only")
2016+
class TestMainAppleTerminal(TestMain):
2017+
"""Test the REPL with Apple Terminal's TERM_PROGRAM set."""
2018+
2019+
def run_repl(self, repl_input, env=None, **kwargs):
2020+
if env is None:
2021+
env = os.environ.copy()
2022+
env["TERM_PROGRAM"] = "Apple_Terminal"
2023+
return super().run_repl(repl_input, env=env, **kwargs)
2024+
2025+
20152026
class TestPyReplCtrlD(TestCase):
20162027
"""Test Ctrl+D behavior in _pyrepl to match old pre-3.13 REPL behavior.
20172028

0 commit comments

Comments
 (0)