Skip to content

Commit 21f094e

Browse files
committed
improve error reporting
1 parent 80cc409 commit 21f094e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/joss_paper/test_gen_phold_space_time_plot.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ class TestPlotLog(unittest.TestCase):
1414
def test(self):
1515
# this tests two things:
1616
# 1) gen_phold_space_time_plot.py
17-
# 2) the use of self.fast_plot_file_logger in de_sim/de_sim/simulation_object.py, which cannot be conveniently
18-
# unit-tested because doing so requires that config state be changed before de_sim.plot.file logger is created
19-
# we run gen_phold_space_time_plot.py in a separate process to execute that code
20-
# also see comment LoggerConfigurator().from_dict() regarding shared loggers
17+
# 2) the use of self.fast_plot_file_logger in de_sim/de_sim/simulation_object.py, which cannot
18+
# be conveniently unit-tested because doing so requires that config state be changed before
19+
# de_sim.plot.file logger is created we run gen_phold_space_time_plot.py in a separate process
20+
# to execute that code.
21+
# also see the comment in LoggerConfigurator().from_dict() regarding shared loggers.
2122
try:
2223
command = ["python3", "joss_paper/gen_phold_space_time_plot.py"]
2324
result = subprocess.run(command,
2425
check=True,
2526
capture_output=True)
26-
except CalledProcessError as e:
27-
e_msg = f"""'{" ".join(command)}' failed: {e.stderr}"""
27+
except subprocess.CalledProcessError as e:
28+
e_msg = f"""'{" ".join(command)}' failed:\n{e.stderr.decode("utf-8")}"""
2829
self.fail(e_msg)
2930

3031
self.assertIn('space-time diagram written', result.stdout.decode("utf-8"))

0 commit comments

Comments
 (0)