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>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user