Skip to content

Commit

Permalink
fix sample grader not actually capturing output
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Nov 10, 2024
1 parent dbb0226 commit 8db46c1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/sample_grader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@
import subprocess
import sys

process = subprocess.run([sys.executable, sys.argv[1]], check=False)
process = subprocess.run(
[sys.executable, sys.argv[1]],
capture_output=True,
check=False,
)

if process.returncode != 0:
print("Encountered exception for test case 0:")
# let the student see the error
print(process.stderr)
print("Score: 0%")
else:
Expand Down

0 comments on commit 8db46c1

Please sign in to comment.