Skip to content

Commit a9b748b

Browse files
committed
Add print statement to list failed examples
1 parent 778f8d4 commit a9b748b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tests/test_diffusion.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class TestSubmissionCommands(unittest.TestCase):
2525
outputs are the same as the reference outputs.
2626
"""
2727

28+
failed_tests = []
29+
2830
def setUp(self):
2931
"""
3032
Grabs files from the examples folder
@@ -66,9 +68,16 @@ def setUp(self):
6668
def test_examples_run_without_errors(self):
6769
for name, (exit_code, output) in sorted(self.exec_status.items()):
6870
with self.subTest(example=name):
71+
if exit_code != 0:
72+
self.__class__.failed_tests.append(f"{name}")
6973
self.assertEqual(exit_code, 0,
7074
msg=f"Example '{name}' exited with {exit_code}\n{output}")
7175

76+
sys.stderr.write("\n==== EXAMPLE FAILURE SUMMARY ====\n")
77+
for line in self.__class__.failed_tests:
78+
sys.stderr.write(f" - {line}\n")
79+
sys.stderr.write("=========================\n\n")
80+
sys.stderr.flush()
7281

7382

7483
def test_commands(self):
@@ -169,7 +178,6 @@ def _write_command(self, bash_file, test_f) -> None:
169178
f.write(output_command)
170179

171180

172-
173181
def execute_through_pty(command_line):
174182
import pty, select
175183

0 commit comments

Comments
 (0)