summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-02-26 10:58:37 +1100
committerAngus Gratton <angus@redyak.com.au>2025-03-04 10:45:23 +1100
commit5f01232dd7c0a211e8beff24dc88efa48598ef36 (patch)
tree9b047ef6e1f290722ad2a5d544c6ec3c798bae8e
parent016ae19cf0e148ba7b33c2c80312b6f3641217dc (diff)
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 <angus@redyak.com.au>
-rwxr-xr-xtests/run-tests.py2
1 files changed, 2 insertions, 0 deletions
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))