summaryrefslogtreecommitdiff
path: root/tests/run-tests.py
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-02-26 11:00:53 +1100
committerAngus Gratton <angus@redyak.com.au>2025-03-04 10:45:23 +1100
commitb4cf82b2d62c60c5e6e10d8d23c6b099b96c6f75 (patch)
tree94db9f8f503dcccea521f5df5e77d8d6fad98c97 /tests/run-tests.py
parent5f01232dd7c0a211e8beff24dc88efa48598ef36 (diff)
test/run-tests: Print a note if it looks like unittest.main() missing.
This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'tests/run-tests.py')
-rwxr-xr-xtests/run-tests.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 38f116136..50adb6b4d 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1004,6 +1004,16 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1):
test_count.increment()
+ # Print a note if this looks like it might have been a misfired unittest
+ if not uses_unittest and not test_passed:
+ with open(test_file, "r") as f:
+ if any(re.match("^import.+unittest", l) for l in f.readlines()):
+ print(
+ "NOTE: {} may be a unittest that doesn't run unittest.main()".format(
+ test_file
+ )
+ )
+
if pyb:
num_threads = 1