From 65b3d064e3c15c6f42f079ff218478c647d86730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20S=C5=82awecki?= Date: Sun, 26 Oct 2025 15:48:03 +0100 Subject: [PATCH] [3.13] gh-137568: Ignore startup file in `test_dumb_terminal_exits_cleanly` (GH-140295) (cherry picked from commit 06c779474c7f53bccb8ebf42c66e73b2488bf488) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartosz Sławecki --- Lib/test/test_pyrepl/test_pyrepl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 364bdf80f3ee2e..a88382f229c569 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1069,6 +1069,9 @@ def test_bracketed_paste_single_line(self): class TestDumbTerminal(ReplTestCase): def test_dumb_terminal_exits_cleanly(self): env = os.environ.copy() + # Ignore PYTHONSTARTUP to not pollute the output + # with an unrelated traceback. See GH-137568. + env.pop('PYTHONSTARTUP', None) env.update({"TERM": "dumb"}) output, exit_code = self.run_repl("exit()\n", env=env) self.assertEqual(exit_code, 0)