Skip to content

Commit 2272ba8

Browse files
committed
Always print 'NO TEST RUN' as a result if any test did not run
1 parent 318e4bb commit 2272ba8

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

Lib/test/libregrtest/main.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,22 +460,28 @@ def display_header(self):
460460
% (locale.getpreferredencoding(False),
461461
sys.getfilesystemencoding()))
462462

463+
def only_test_that_did_not_run(self):
464+
465+
return (self.run_no_tests and
466+
not any((self.good, self.bad, self.skipped,
467+
self.interrupted, self.environment_changed)))
468+
463469
def get_tests_result(self):
464470
result = []
465471
if self.bad:
466472
result.append("FAILURE")
467473
elif self.ns.fail_env_changed and self.environment_changed:
468474
result.append("ENV CHANGED")
469-
elif not any((self.good, self.bad, self.skipped, self.interrupted,
470-
self.environment_changed)):
471-
result.append("NO TEST RUN")
472475

473476
if self.interrupted:
474477
result.append("INTERRUPTED")
475478

476-
if not result:
479+
if not result and not self.only_test_that_did_not_run():
477480
result.append("SUCCESS")
478481

482+
if self.run_no_tests:
483+
result.append("NO TEST RUN")
484+
479485
result = ', '.join(result)
480486
if self.first_result:
481487
result = '%s then %s' % (self.first_result, result)

Lib/test/test_regrtest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,11 +480,14 @@ def list_regex(line_format, tests):
480480
result.append('ENV CHANGED')
481481
if interrupted:
482482
result.append('INTERRUPTED')
483-
if not any((good, result, failed, interrupted, skipped,
484-
env_changed, fail_env_changed)):
485-
result.append("NO TEST RUN")
486-
elif not result:
483+
484+
only_no_test_run = (no_test_ran and not any((good, failed, skipped,
485+
interrupted, env_changed)))
486+
487+
if not result and not only_no_test_run:
487488
result.append('SUCCESS')
489+
if no_test_ran:
490+
result.append("NO TEST RUN")
488491
result = ', '.join(result)
489492
if rerun:
490493
self.check_line(output, 'Tests result: %s' % result)

0 commit comments

Comments
 (0)