Skip to content

Commit c1a62af

Browse files
author
Release Manager
committed
gh-40332: Use `python3 -m sage.doctest` in doctest results report if not using `sage-runtests` Instead of `sage -t`, which no longer works with meson URL: #40332 Reported by: Antonio Rojas Reviewer(s): Antonio Rojas, Tobias Diez
2 parents dda9605 + 7ff88f2 commit c1a62af

File tree

5 files changed

+61
-61
lines changed

5 files changed

+61
-61
lines changed

src/sage/doctest/control.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ def run_doctests(self):
11241124
sage: DC.expand_files_into_sources()
11251125
sage: DC.run_doctests()
11261126
Doctesting 1 file.
1127-
sage -t .../sage/rings/homset.py
1127+
.../sage/rings/homset.py
11281128
[... tests, ...s wall]
11291129
----------------------------------------------------------------------
11301130
All tests passed!
@@ -1201,7 +1201,7 @@ def cleanup(self, final=True):
12011201
sage: DC.run()
12021202
Running doctests with ID ...
12031203
Doctesting 1 file.
1204-
sage -t .../rings/all.py
1204+
.../rings/all.py
12051205
[... tests, ...s wall]
12061206
----------------------------------------------------------------------
12071207
All tests passed!
@@ -1403,7 +1403,7 @@ def run(self):
14031403
sage: DC.run()
14041404
Running doctests with ID ...
14051405
Doctesting 1 file.
1406-
sage -t .../sage/sets/non_negative_integers.py
1406+
.../sage/sets/non_negative_integers.py
14071407
[... tests, ...s wall]
14081408
----------------------------------------------------------------------
14091409
All tests passed!
@@ -1427,7 +1427,7 @@ def run(self):
14271427
Using --optional=external,sage
14281428
Features to be detected: ...
14291429
Doctesting 1 file.
1430-
sage -t ....py
1430+
....py
14311431
[0 tests, ...s wall]
14321432
----------------------------------------------------------------------
14331433
All tests passed!
@@ -1453,7 +1453,7 @@ def run(self):
14531453
Using --optional=sage...
14541454
Features to be detected: ...
14551455
Doctesting 1 file.
1456-
sage -t ....py
1456+
....py
14571457
[4 tests, ...s wall]
14581458
----------------------------------------------------------------------
14591459
All tests passed!
@@ -1471,7 +1471,7 @@ def run(self):
14711471
Using --optional=sage
14721472
Features to be detected: ...
14731473
Doctesting 1 file.
1474-
sage -t ....py
1474+
....py
14751475
[4 tests, ...s wall]
14761476
----------------------------------------------------------------------
14771477
All tests passed!
@@ -1597,7 +1597,7 @@ def run_doctests(module, options=None):
15971597
sage: run_doctests(sage.rings.all)
15981598
Running doctests with ID ...
15991599
Doctesting 1 file.
1600-
sage -t .../sage/rings/all.py
1600+
.../sage/rings/all.py
16011601
[... tests, ...s wall]
16021602
----------------------------------------------------------------------
16031603
All tests passed!

src/sage/doctest/forker.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,9 +1781,9 @@ def serial_dispatch(self):
17811781
sage: DC.dispatcher = DD
17821782
sage: DC.timer = Timer().start()
17831783
sage: DD.serial_dispatch()
1784-
sage -t .../rings/homset.py
1784+
.../rings/homset.py
17851785
[... tests, ...s wall]
1786-
sage -t .../rings/ideal.py
1786+
.../rings/ideal.py
17871787
[... tests, ...s wall]
17881788
"""
17891789
for source in self.controller.sources:
@@ -1827,9 +1827,9 @@ def parallel_dispatch(self):
18271827
sage: DC.dispatcher = DD
18281828
sage: DC.timer = Timer().start()
18291829
sage: DD.parallel_dispatch()
1830-
sage -t .../databases/cremona.py
1830+
.../databases/cremona.py
18311831
[... tests, ...s wall]
1832-
sage -t .../rings/big_oh.py
1832+
.../rings/big_oh.py
18331833
[... tests, ...s wall]
18341834
18351835
If the ``exitfirst=True`` option is given, the results for a failing
@@ -1853,7 +1853,7 @@ def parallel_dispatch(self):
18531853
....: DC.dispatcher = DD
18541854
....: DC.timer = Timer().start()
18551855
....: DD.parallel_dispatch()
1856-
sage -t ...
1856+
...
18571857
**********************************************************************
18581858
File "...", line 2, in ...
18591859
Failed example:
@@ -2158,9 +2158,9 @@ def dispatch(self):
21582158
sage: DC.dispatcher = DD
21592159
sage: DC.timer = Timer().start()
21602160
sage: DD.dispatch()
2161-
sage -t .../sage/modules/free_module_homspace.py
2161+
.../sage/modules/free_module_homspace.py
21622162
[... tests, ...s wall]
2163-
sage -t .../sage/rings/big_oh.py
2163+
.../sage/rings/big_oh.py
21642164
[... tests, ...s wall]
21652165
"""
21662166
if self.controller.options.serial:
@@ -2223,7 +2223,7 @@ def __init__(self, source, options, funclist=[], baseline=None):
22232223
sage: run_doctests(sage.rings.big_oh) # indirect doctest
22242224
Running doctests with ID ...
22252225
Doctesting 1 file.
2226-
sage -t .../sage/rings/big_oh.py
2226+
.../sage/rings/big_oh.py
22272227
[... tests, ...s wall]
22282228
----------------------------------------------------------------------
22292229
All tests passed!
@@ -2270,7 +2270,7 @@ def run(self):
22702270
sage: run_doctests(sage.symbolic.units) # indirect doctest # needs sage.symbolic
22712271
Running doctests with ID ...
22722272
Doctesting 1 file.
2273-
sage -t .../sage/symbolic/units.py
2273+
.../sage/symbolic/units.py
22742274
[... tests, ...s wall]
22752275
----------------------------------------------------------------------
22762276
All tests passed!

src/sage/doctest/reporting.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import re
4545
import sys
4646
from signal import SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, Signals
47-
from sys import stdout
47+
from sys import argv, stdout
4848

4949
from sage.doctest.external import available_software
5050
from sage.doctest.sources import DictAsObject
@@ -185,17 +185,17 @@ def report_head(self, source, fail_msg=None):
185185
sage: DC = DocTestController(DD, [filename])
186186
sage: DTR = DocTestReporter(DC)
187187
sage: print(DTR.report_head(FDS))
188-
sage -t .../sage/doctest/reporting.py
188+
.../sage/doctest/reporting.py
189189
190190
The same with various options::
191191
192192
sage: DD.long = True
193193
sage: print(DTR.report_head(FDS))
194-
sage -t --long .../sage/doctest/reporting.py
194+
... --long .../sage/doctest/reporting.py
195195
sage: print(DTR.report_head(FDS, "Failed by self-sabotage"))
196-
sage -t --long .../sage/doctest/reporting.py # Failed by self-sabotage
196+
... --long .../sage/doctest/reporting.py # Failed by self-sabotage
197197
"""
198-
cmd = "sage -t"
198+
cmd = "sage-runtests" if "sage-runtests" in argv[0] else "python3 -m sage.doctest"
199199
if self.controller.options.long:
200200
cmd += " --long"
201201

@@ -695,9 +695,9 @@ def finalize(self):
695695
sage: DC.sources = [None] * 4 # to fool the finalize method
696696
sage: DTR.finalize()
697697
----------------------------------------------------------------------
698-
sage -t .../sage/doctest/reporting.py # Timed out
699-
sage -t .../sage/doctest/reporting.py # Bad exit: 3
700-
sage -t .../sage/doctest/reporting.py # 1 doctest failed
698+
.../sage/doctest/reporting.py # Timed out
699+
.../sage/doctest/reporting.py # Bad exit: 3
700+
.../sage/doctest/reporting.py # 1 doctest failed
701701
----------------------------------------------------------------------
702702
Total time for all tests: 0.0 seconds
703703
cpu time: 0.0 seconds
@@ -710,9 +710,9 @@ def finalize(self):
710710
sage: DTR.finalize()
711711
<BLANKLINE>
712712
----------------------------------------------------------------------
713-
sage -t .../sage/doctest/reporting.py # Timed out
714-
sage -t .../sage/doctest/reporting.py # Bad exit: 3
715-
sage -t .../sage/doctest/reporting.py # 1 doctest failed
713+
.../sage/doctest/reporting.py # Timed out
714+
.../sage/doctest/reporting.py # Bad exit: 3
715+
.../sage/doctest/reporting.py # 1 doctest failed
716716
Doctests interrupted: 4/6 files tested
717717
----------------------------------------------------------------------
718718
Total time for all tests: 0.0 seconds

0 commit comments

Comments
 (0)