Skip to content

Commit 269bc17

Browse files
committed
Fix tests
1 parent ca9f960 commit 269bc17

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/pytest_pl_grader/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ def sandbox(request: pytest.FixtureRequest, data_json: dict[str, Any] | None) ->
150150
# TODO make this not an assert?
151151
assert output_level == GradingOutputLevel.FullTraceback
152152

153-
exception_traceback = response.get("execution_traceback", "")
154-
fail_message += f"{os.linesep * 2}Traceback:{os.linesep}{exception_traceback}"
153+
if exception_traceback := response.get("execution_traceback", ""):
154+
fail_message += f"{os.linesep * 2}{exception_traceback}"
155155

156156
pytest.fail(fail_message, pytrace=False)
157157

tests/scenario_root/test_quiz_2_1/expected_outcome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"max_points": 6,
25-
"message": "Student code execution failed with an exception:\nRuntimeError",
25+
"message": "Student code execution failed with an exception: RuntimeError",
2626
"name": "Test analyze_vibration function",
2727
"outcome": "error",
2828
"points_frac": 0.0,
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"max_points": 6,
34-
"message": "Student code execution failed with an exception:\nRuntimeError",
34+
"message": "Student code execution failed with an exception: RuntimeError",
3535
"name": "Test analyze_vibration function",
3636
"outcome": "error",
3737
"points_frac": 0.0,

0 commit comments

Comments
 (0)