Skip to content

Commit b4cf82b

Browse files
committed
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 <[email protected]>
1 parent 5f01232 commit b4cf82b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: tests/run-tests.py

+10
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,16 @@ def run_one_test(test_file):
10041004

10051005
test_count.increment()
10061006

1007+
# Print a note if this looks like it might have been a misfired unittest
1008+
if not uses_unittest and not test_passed:
1009+
with open(test_file, "r") as f:
1010+
if any(re.match("^import.+unittest", l) for l in f.readlines()):
1011+
print(
1012+
"NOTE: {} may be a unittest that doesn't run unittest.main()".format(
1013+
test_file
1014+
)
1015+
)
1016+
10071017
if pyb:
10081018
num_threads = 1
10091019

0 commit comments

Comments
 (0)