Skip to content

Commit 40dfc5f

Browse files
committed
Fix test fail by suppress warning
1 parent abb8d01 commit 40dfc5f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/sage/rings/qqbar.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7083,7 +7083,7 @@ def complex_roots(self, prec, multiplicity):
70837083
return roots
70847084

70857085
def exactify(self):
7086-
"""
7086+
r"""
70877087
Compute a common field that holds all of the algebraic coefficients
70887088
of this polynomial, then factor the polynomial over that field.
70897089
Store the factors for later use (ignoring multiplicity).
@@ -7107,12 +7107,13 @@ def exactify(self):
71077107
sage: p = AA(2)^(1/100) * x + AA(3)^(1/100)
71087108
sage: cp = AA.common_polynomial(p)
71097109
sage: from sage.doctest.util import ensure_interruptible_after
7110-
sage: with ensure_interruptible_after(0.5): cp.generator()
7111-
doctest:warning...
7112-
RuntimeWarning: cypari2 leaked ... bytes on the PARI stack
7113-
sage: with ensure_interruptible_after(0.5): cp.generator()
7114-
doctest:warning...
7115-
RuntimeWarning: cypari2 leaked ... bytes on the PARI stack
7110+
sage: from warnings import catch_warnings, filterwarnings
7111+
sage: with ensure_interruptible_after(0.5), catch_warnings():
7112+
....: filterwarnings("ignore", r"cypari2 leaked \d+ bytes on the PARI stack")
7113+
....: cp.generator()
7114+
sage: with ensure_interruptible_after(0.5), catch_warnings():
7115+
....: filterwarnings("ignore", r"cypari2 leaked \d+ bytes on the PARI stack")
7116+
....: cp.generator()
71167117
"""
71177118
if self._exact:
71187119
return

0 commit comments

Comments
 (0)