diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 2cfbdd12b2a58d2..e068b925d57af00 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -116,6 +116,8 @@ def accumulate_result(self, test, result): elif ok == RESOURCE_DENIED: self.skipped.append(test) self.resource_denieds.append(test) + elif ok != INTERRUPTED: + raise ValueError("invalid test result: %r" % ok) def display_progress(self, test_index, test): if self.ns.quiet: diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index 34b3ae6a976c5c3..779ff01a649c6cc 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -124,13 +124,13 @@ def _runtest(self): finally: self.current_test = None - stdout, _, result = stdout.strip().rpartition("\n") if retcode != 0: result = (CHILD_ERROR, "Exit code %s" % retcode) self.output.put((test, stdout.rstrip(), stderr.rstrip(), result)) return False + stdout, _, result = stdout.strip().rpartition("\n") if not result: self.output.put((None, None, None, None)) return True