Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Nov 11, 2024
1 parent c7bd2a6 commit d82dc7c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Lib/test/libregrtest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,18 @@ def finalize_tests(self, coverage: trace.CoverageResults | None) -> None:
self.results.write_junit(self.junit_filename)

def display_summary(self) -> None:
if self.first_runtests is None:
raise ValueError(
"Should never call `display_summary()` before calling `_run_test()`"
)

duration = time.perf_counter() - self.logger.start_time
filtered = bool(self.match_tests)

# Total duration
print()
print("Total duration: %s" % format_duration(duration))

assert self.first_runtests, (
"Should never call `display_summary()` before calling `_run_test()`"
)
self.results.display_summary(self.first_runtests, filtered)

# Result
Expand Down Expand Up @@ -717,9 +719,10 @@ def _init(self):

@property
def tmp_dir(self) -> StrPath:
assert self._tmp_dir is not None, (
"Should never use `.tmp_dir` before calling `.main()`"
)
if self._tmp_dir is None:
raise ValueError(
"Should never use `.tmp_dir` before calling `.main()`"
)
return self._tmp_dir

def main(self, tests: TestList | None = None) -> NoReturn:
Expand Down

0 comments on commit d82dc7c

Please sign in to comment.