diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-03-27 16:28:15 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-03-27 16:28:15 (GMT) |
commit | 622583e9bf19b79b621eba8c5798acdf175a17d2 (patch) | |
tree | 401f1edc63f326529093525eacdfdec6e24f1806 /Lib | |
parent | 598b198ca6f5d590bb674f9c0d92087dea6642b0 (diff) | |
download | cpython-622583e9bf19b79b621eba8c5798acdf175a17d2.zip cpython-622583e9bf19b79b621eba8c5798acdf175a17d2.tar.gz cpython-622583e9bf19b79b621eba8c5798acdf175a17d2.tar.bz2 |
regrtest: round final timing towards +inf
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/libregrtest/main.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index e1367da..447d99f 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -1,5 +1,6 @@ import datetime import faulthandler +import math import os import platform import random @@ -106,9 +107,13 @@ class Regrtest: self.skipped.append(test) self.resource_denieds.append(test) - def time_delta(self): + def time_delta(self, ceil=False): seconds = time.monotonic() - self.start_time - return datetime.timedelta(seconds=int(seconds)) + if ceil: + seconds = math.ceil(seconds) + else: + seconds = int(seconds) + return datetime.timedelta(seconds=seconds) def display_progress(self, test_index, test): if self.ns.quiet: @@ -409,7 +414,7 @@ class Regrtest: r.write_results(show_missing=True, summary=True, coverdir=self.ns.coverdir) - print("Total duration: %s" % self.time_delta()) + print("Total duration: %s" % self.time_delta(ceil=True)) if self.ns.runleaks: os.system("leaks %d" % os.getpid()) |