Skip to content

Commit

Permalink
Update python test script.
Browse files Browse the repository at this point in the history
  • Loading branch information
krahets committed Nov 2, 2023
1 parent 8dbfc69 commit 868dc05
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions codes/python/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# find source code files
src_paths = sorted(glob.glob("codes/python/chapter_*/*.py"))
errors = []
error_count = 0

# run python code
for src_path in src_paths:
Expand All @@ -21,8 +20,8 @@
exit_status = process.returncode
if exit_status != 0:
errors.append(stderr)
error_count += 1

print(f"===== Found exception in {error_count} files =====")
for error in errors:
print(error + "\n")
print(f"===== Tested {len(src_paths)} files =====")
if len(errors) > 0:
errors.insert(0, f"Found exception in {len(errors)} files")
raise RuntimeError("\n\n".join(errors))

0 comments on commit 868dc05

Please sign in to comment.