Skip to content

Commit

Permalink
src/sage/doctest/forker.py: specify walltime in sage -t --verbose output
Browse files Browse the repository at this point in the history
Now that cpu seconds are used for --warn-long, we should disambiguate
wherever wall seconds are still used. One such place is in the verbose
test runner output, which outputs (for example)

  ok [3.83 s]

after a test that took 3.83 wall seconds. This commit changes that
output to

  ok [3.83s wall]

which is unmistakable.

Closes: sagemathGH-32981
  • Loading branch information
orlitzky committed Apr 16, 2024
1 parent 1baf340 commit 8880921
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sage/doctest/forker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,12 +1378,12 @@ def report_success(self, out, test, example, got, *, check_timer=None):
sage: check.walltime = 2.71
sage: DTR.report_success(sys.stdout.write, doctests[0], ex, '1764',
....: check_timer=check)
ok [3.83 s]
ok [3.83s wall]
"""
# We completely replace doctest.DocTestRunner.report_success
# so that we can include time taken for the test
if self._verbose:
out("ok [%.2f s]\n" %
out("ok [%.2fs wall]\n" %
(example.walltime + check_timer.walltime))

def report_failure(self, out, test, example, got, globs):
Expand Down

0 comments on commit 8880921

Please sign in to comment.