Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests output for Python 3.13 #39187

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/doc/de/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ Beachten Sie, dass Python zwischen Klein- und Großschreibung unterscheidet:
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,4 @@ Note that Python is case sensitive:
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
2 changes: 1 addition & 1 deletion src/doc/fr/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,4 +241,4 @@ Notez que Python distingue les majuscules des minuscules :
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,4 @@ Pythonでは,大文字小文字が区別されることに注意:
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ Note que o Python é sensível a maiúsculas e minúsculas:
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
2 changes: 1 addition & 1 deletion src/doc/ru/tutorial/tour_linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ Sage поддерживает разреженную линейную алгеб
sage: M = MatrixSpace(QQ, 10,10, Sparse=True)
Traceback (most recent call last):
...
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'
TypeError: ...__init__() got an unexpected keyword argument 'Sparse'...
4 changes: 2 additions & 2 deletions src/sage/categories/map.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ cdef class Map(Element):
maps::

sage: phi.domain # needs sage.rings.number_field
<weakref at ...; to 'NumberField_quadratic_with_category' at ...>
<weakref at ...; to '...NumberField_quadratic_with_category' at ...>
sage: phi._make_strong_references() # needs sage.rings.number_field
sage: print(phi.domain) # needs sage.rings.number_field
The constant function (...) -> Number Field in a
Expand Down Expand Up @@ -343,7 +343,7 @@ cdef class Map(Element):
maps::

sage: phi.domain # needs sage.rings.number_field
<weakref at ...; to 'NumberField_quadratic_with_category' at ...>
<weakref at ...; to '...NumberField_quadratic_with_category' at ...>
sage: phi._make_strong_references() # needs sage.rings.number_field
sage: print(phi.domain) # needs sage.rings.number_field
The constant function (...) -> Number Field in a
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/bindable_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class BindableClass(metaclass=ClasscallMetaclass):
Still, documentation works as usual::

sage: outer.Inner.__doc__
' some documentation '
'...some documentation '

TESTS::

Expand Down
14 changes: 7 additions & 7 deletions src/sage/misc/sagedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@
We check that the todo Sphinx extension is correctly activated::

sage: sage.misc.sagedoc.format(sage.combinat.ranker.on_fly.__doc__) # needs sphinx
" Return ... Todo: add tests as in combinat::rankers\n"
"...Return ...Todo: add tests as in combinat::rankers\n"

In the following use case, the ``nodetex`` directive would have been ignored prior
to :issue:`11815`::
Expand Down Expand Up @@ -1135,10 +1135,11 @@
The following produces an error because the string 'fetch(' is a
malformed regular expression::

sage: print(search_src(" fetch(", "def", interact=False))
Traceback (most recent call last):
...
error: missing ), unterminated subpattern at position 6
sage: try:
....: print(search_src(" fetch(", "def", interact=False))
....: except Exception as e:
....: print(e)
missing ), unterminated subpattern at position 6

To fix this, *escape* the parenthesis with a backslash::

Expand Down Expand Up @@ -1186,7 +1187,6 @@
misc/sagedoc.py:... len(search_src("matrix", interact=False).splitlines())...
misc/sagedoc.py:... len(search_src("matrix", module="sage.calculus", interact=False).splitlines())...
misc/sagedoc.py:... len(search_src("matrix", path_re="calc"...
misc/sagedoc.py:... print(search_src(" fetch(", "def", interact=False))...
misc/sagedoc.py:... print(search_src(r" fetch\(", "def", interact=False))...
misc/sagedoc.py:... print(search_src(r" fetch\(", "def", "pyx", interact=False))...
misc/sagedoc.py:... s = search_src('Matrix', path_re='matrix', interact=False); s.find('x') > 0...
Expand Down Expand Up @@ -1251,7 +1251,7 @@

sage: # long time, needs sagemath_doc_html
sage: N = len(search_doc('tree', interact=False).splitlines())
sage: L = search_doc('tree', whole_word=True, interact=False).splitlines()

Check warning on line 1254 in src/sage/misc/sagedoc.py

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[g-o]*)

Warning: slow doctest:

slow doctest:
sage: len(L) < N
True
sage: import re
Expand Down Expand Up @@ -1456,7 +1456,7 @@
sage: browse_sage_doc._open("reference", testing=True)[0] # needs sagemath_doc_html
'http://localhost:8000/doc/live/reference/index.html'
sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] # needs sage.modules
'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
'...Full MatrixSpace of 3 by 3 sparse matrices...'
"""
def __init__(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/sageinspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ def sage_getdoc(obj, obj_name='', embedded=False):
sage: from sage.misc.sageinspect import sage_getdoc
sage: sage_getdoc(identity_matrix)[87:124] # needs sage.modules
'Return the n x n identity matrix over'
'...the n x n identity matrix...'
sage: def f(a, b, c, d=1): return a+b+c+d
...
sage: import functools
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/modsym/modsym.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def ModularSymbols(group=1,
{}
sage: M = ModularSymbols(11,use_cache=True)
sage: sage.modular.modsym.modsym._cache
{(Congruence Subgroup Gamma0(11), 2, 0, Rational Field): <weakref at ...; to 'ModularSymbolsAmbient_wt2_g0_with_category' at ...>}
{(Congruence Subgroup Gamma0(11), 2, 0, Rational Field): <weakref at ...; to '...ModularSymbolsAmbient_wt2_g0_with_category' at ...>}
sage: M is ModularSymbols(11,use_cache=True)
True
sage: M is ModularSymbols(11,use_cache=False)
Expand Down
4 changes: 2 additions & 2 deletions src/sage/repl/attach.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
....: traceback.print_exc(file=sys.stdout)
Traceback (most recent call last):
...
exec(preparse_file(f.read()) + "\n", globals)
exec(preparse_file(f.read()) + "\n", globals)...
File "<string>", line 3, in <module>
ValueError: third
sage: detach(src)
Expand All @@ -52,7 +52,7 @@
....: traceback.print_exc(file=sys.stdout)
Traceback (most recent call last):
...
exec(code, globals)
exec(code, globals)...
File ".../foobar...sage.py", line ..., in <module>
raise ValueError("third") # this should appear in the source snippet...
ValueError: third
Expand Down
2 changes: 1 addition & 1 deletion src/sage/repl/rich_output/pretty_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def pretty_print(self):
sage: seq._concatenate_graphs().show(edge_labels=True) # needs sage.graphs sage.plot
Traceback (most recent call last):
...
TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'
TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'...
"""
try:
from sage.plot.plot import Graphics
Expand Down
Loading