From 1469452fadf20875aab55f21fae7d37b7e4b99ab Mon Sep 17 00:00:00 2001 From: Philipp Schrader Date: Mon, 28 Jul 2025 15:27:15 -0700 Subject: [PATCH 1/2] fix: Print REPL error message during test failures I noticed that the CI error messages for #3114 are not useful. This patch aims to help with that by printing the output of the REPL code. If there's an exception during startup for example, then the test log will now contain the stack trace. --- tests/repl/repl_test.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/repl/repl_test.py b/tests/repl/repl_test.py index 37c9a37a0d..53b07fdb15 100644 --- a/tests/repl/repl_test.py +++ b/tests/repl/repl_test.py @@ -29,13 +29,16 @@ def setUp(self): def run_code_in_repl(self, lines: Iterable[str], *, env=None) -> str: """Runs the lines of code in the REPL and returns the text output.""" - return subprocess.check_output( - [self.repl], - text=True, - stderr=subprocess.STDOUT, - input="\n".join(lines), - env=env, - ).strip() + try: + return subprocess.check_output( + [self.repl], + text=True, + stderr=subprocess.STDOUT, + input="\n".join(lines), + env=env, + ).strip() + except subprocess.CalledProcessError as error: + raise ValueError(f"Failed to run the REPL:\n{error.stdout}") from error def test_repl_version(self): """Validates that we can successfully execute arbitrary code on the REPL.""" From 928b79d5d625190ebd9cbf643dcc0ba7c1cadcd7 Mon Sep 17 00:00:00 2001 From: Philipp Schrader Date: Mon, 28 Jul 2025 15:30:58 -0700 Subject: [PATCH 2/2] fix exception type --- tests/repl/repl_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/repl/repl_test.py b/tests/repl/repl_test.py index 53b07fdb15..01d0442922 100644 --- a/tests/repl/repl_test.py +++ b/tests/repl/repl_test.py @@ -38,7 +38,7 @@ def run_code_in_repl(self, lines: Iterable[str], *, env=None) -> str: env=env, ).strip() except subprocess.CalledProcessError as error: - raise ValueError(f"Failed to run the REPL:\n{error.stdout}") from error + raise RuntimeError(f"Failed to run the REPL:\n{error.stdout}") from error def test_repl_version(self): """Validates that we can successfully execute arbitrary code on the REPL."""