Skip to content

Commit c02f241

Browse files
author
Release Manager
committedJan 1, 2025
sagemathgh-39187: Fix tests output for Python 3.13 Mostly caused by leading spaces being stripped in docs printing, and suggestions being offered for incorrect keywords. URL: sagemath#39187 Reported by: Antonio Rojas Reviewer(s): Tobias Diez
2 parents 7cf2738 + fd10889 commit c02f241

File tree

13 files changed

+21
-21
lines changed

13 files changed

+21
-21
lines changed
 

‎src/doc/de/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,4 +241,4 @@ Beachten Sie, dass Python zwischen Klein- und Großschreibung unterscheidet:
241241
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
242242
Traceback (most recent call last):
243243
...
244-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
244+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/doc/en/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,4 +235,4 @@ Note that Python is case sensitive:
235235
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
236236
Traceback (most recent call last):
237237
...
238-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
238+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/doc/fr/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,4 @@ Notez que Python distingue les majuscules des minuscules :
237237
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
238238
Traceback (most recent call last):
239239
...
240-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
240+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/doc/ja/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,4 @@ Pythonでは,大文字小文字が区別されることに注意:
248248
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
249249
Traceback (most recent call last):
250250
...
251-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
251+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/doc/pt/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@ Note que o Python é sensível a maiúsculas e minúsculas:
216216
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
217217
Traceback (most recent call last):
218218
...
219-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
219+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/doc/ru/tutorial/tour_linalg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@ Sage поддерживает разреженную линейную алгеб
210210
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
211211
Traceback (most recent call last):
212212
...
213-
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
213+
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...

‎src/sage/categories/map.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ cdef class Map(Element):
275275
maps::
276276
277277
sage: phi.domain # needs sage.rings.number_field
278-
<weakref at ...; to 'NumberField_quadratic_with_category' at ...>
278+
<weakref at ...; to '...NumberField_quadratic_with_category' at ...>
279279
sage: phi._make_strong_references() # needs sage.rings.number_field
280280
sage: print(phi.domain) # needs sage.rings.number_field
281281
The constant function (...) -> Number Field in a
@@ -343,7 +343,7 @@ cdef class Map(Element):
343343
maps::
344344
345345
sage: phi.domain # needs sage.rings.number_field
346-
<weakref at ...; to 'NumberField_quadratic_with_category' at ...>
346+
<weakref at ...; to '...NumberField_quadratic_with_category' at ...>
347347
sage: phi._make_strong_references() # needs sage.rings.number_field
348348
sage: print(phi.domain) # needs sage.rings.number_field
349349
The constant function (...) -> Number Field in a

‎src/sage/misc/bindable_class.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class BindableClass(metaclass=ClasscallMetaclass):
113113
Still, documentation works as usual::
114114
115115
sage: outer.Inner.__doc__
116-
' some documentation '
116+
'...some documentation '
117117
118118
TESTS::
119119

‎src/sage/misc/sagedoc.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def format(s, embedded=False):
694694
We check that the todo Sphinx extension is correctly activated::
695695
696696
sage: sage.misc.sagedoc.format(sage.combinat.ranker.on_fly.__doc__) # needs sphinx
697-
" Return ... Todo: add tests as in combinat::rankers\n"
697+
"...Return ...Todo: add tests as in combinat::rankers\n"
698698
699699
In the following use case, the ``nodetex`` directive would have been ignored prior
700700
to :issue:`11815`::
@@ -1135,10 +1135,11 @@ def search_src(string, extra1='', extra2='', extra3='', extra4='',
11351135
The following produces an error because the string 'fetch(' is a
11361136
malformed regular expression::
11371137
1138-
sage: print(search_src(" fetch(", "def", interact=False))
1139-
Traceback (most recent call last):
1140-
...
1141-
error: missing ), unterminated subpattern at position 6
1138+
sage: try:
1139+
....: print(search_src(" fetch(", "def", interact=False))
1140+
....: except Exception as e:
1141+
....: print(e)
1142+
missing ), unterminated subpattern at position 6
11421143
11431144
To fix this, *escape* the parenthesis with a backslash::
11441145
@@ -1186,7 +1187,6 @@ def search_src(string, extra1='', extra2='', extra3='', extra4='',
11861187
misc/sagedoc.py:... len(search_src("matrix", interact=False).splitlines())...
11871188
misc/sagedoc.py:... len(search_src("matrix", module="sage.calculus", interact=False).splitlines())...
11881189
misc/sagedoc.py:... len(search_src("matrix", path_re="calc"...
1189-
misc/sagedoc.py:... print(search_src(" fetch(", "def", interact=False))...
11901190
misc/sagedoc.py:... print(search_src(r" fetch\(", "def", interact=False))...
11911191
misc/sagedoc.py:... print(search_src(r" fetch\(", "def", "pyx", interact=False))...
11921192
misc/sagedoc.py:... s = search_src('Matrix', path_re='matrix', interact=False); s.find('x') > 0...
@@ -1456,7 +1456,7 @@ class _sage_doc:
14561456
sage: browse_sage_doc._open("reference", testing=True)[0] # needs sagemath_doc_html
14571457
'http://localhost:8000/doc/live/reference/index.html'
14581458
sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # needs sage.modules
1459-
'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
1459+
'...Full MatrixSpace of 3 by 3 sparse matrices...'
14601460
"""
14611461
def __init__(self):
14621462
"""

‎src/sage/misc/sageinspect.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ def sage_getdoc(obj, obj_name='', embedded=False):
19861986
19871987
sage: from sage.misc.sageinspect import sage_getdoc
19881988
sage: sage_getdoc(identity_matrix)[87:124] # needs sage.modules
1989-
'Return the n x n identity matrix over'
1989+
'...the n x n identity matrix...'
19901990
sage: def f(a, b, c, d=1): return a+b+c+d
19911991
...
19921992
sage: import functools

‎src/sage/modular/modsym/modsym.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def ModularSymbols(group=1,
351351
{}
352352
sage: M = ModularSymbols(11,use_cache=True)
353353
sage: sage.modular.modsym.modsym._cache
354-
{(Congruence Subgroup Gamma0(11), 2, 0, Rational Field): <weakref at ...; to 'ModularSymbolsAmbient_wt2_g0_with_category' at ...>}
354+
{(Congruence Subgroup Gamma0(11), 2, 0, Rational Field): <weakref at ...; to '...ModularSymbolsAmbient_wt2_g0_with_category' at ...>}
355355
sage: M is ModularSymbols(11,use_cache=True)
356356
True
357357
sage: M is ModularSymbols(11,use_cache=False)

‎src/sage/repl/attach.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
....: traceback.print_exc(file=sys.stdout)
4141
Traceback (most recent call last):
4242
...
43-
exec(preparse_file(f.read()) + "\n", globals)
43+
exec(preparse_file(f.read()) + "\n", globals)...
4444
File "<string>", line 3, in <module>
4545
ValueError: third
4646
sage: detach(src)
@@ -52,7 +52,7 @@
5252
....: traceback.print_exc(file=sys.stdout)
5353
Traceback (most recent call last):
5454
...
55-
exec(code, globals)
55+
exec(code, globals)...
5656
File ".../foobar...sage.py", line ..., in <module>
5757
raise ValueError("third") # this should appear in the source snippet...
5858
ValueError: third

‎src/sage/repl/rich_output/pretty_print.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def pretty_print(self):
160160
sage: seq._concatenate_graphs().show(edge_labels=True) # needs sage.graphs sage.plot
161161
Traceback (most recent call last):
162162
...
163-
TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'
163+
TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'...
164164
"""
165165
try:
166166
from sage.plot.plot import Graphics

0 commit comments

Comments
 (0)