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 <angus@redyak.com.au>
1 parent 5f01232 commit b4cf82b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/run-tests.py

Lines changed: 10 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy