From 5f01232dd7c0a211e8beff24dc88efa48598ef36 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 26 Feb 2025 10:58:37 +1100 Subject: [PATCH] tests/run-tests: Remove any 'expected' file from a unittest run. This won't be generated normally, but a failed run (for example, from a unittest with an error or which doesn't call unittest.main()) will generate one. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- tests/run-tests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/run-tests.py b/tests/run-tests.py index 1af3dfc29..38f116136 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -996,6 +996,8 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): if output_expected is not None: with open(filename_expected, "wb") as f: f.write(output_expected) + else: + rm_f(filename_expected) # in case left over from previous failed run with open(filename_mupy, "wb") as f: f.write(output_mupy) failed_tests.append((test_name, test_file))