Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/sage/doctest/forker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,18 @@ def _failure_header(self, test, example, message='Failed example:', extra=None):
Hello there!
doctest_var = 42; doctest_var^2
<BLANKLINE>

TESTS:

Test GitHub output format (used for GitHub Actions annotations)::

sage: DTR.options.format = 'github'
sage: print(DTR._failure_header(doctests[0], ex))
**********************************************************************
::error title=Failed example:,file=.../sage/doctest/forker.py,line=12::Failed example:
doctest_var = 42; doctest_var^2
<BLANKLINE>
sage: DTR.options.format = 'sage'
"""
out = [self.DIVIDER]
with OriginalSource(example):
Expand Down
8 changes: 8 additions & 0 deletions src/sage/doctest/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ def _log_failure(self, source, fail_msg, event, output=None):
Tests run before process (pid=1234) timed out:
Output so far...
**********************************************************************

TESTS:

Test GitHub output format (used for GitHub Actions annotations)::

sage: DTR.controller.options.format = 'github'
sage: DTR._log_failure(FDS, "Timed out", "process (pid=1234) timed out", "Output so far...")
::error title=Timed out,file=.../sage/doctest/reporting.py::Output so far...
"""
log = self.controller.log
format = self.controller.options.format
Expand Down
Loading