Skip to content

Commit b918a1c

Browse files
committed
src/sage/libs/mpmath/ext_main.pyx: handle ugly mpmath output
There's a test in this file that is trying to use the global property mp.pretty=True but is failing on my machine. Since the test is inside a TESTS block and not visible to end users, the simplest way to fix it is to expect the ugly output from mpmath; although in one instance we do call str() on an mpmath real number to obtain '2.3' instead of some 2.999... thing that would require a tolerance.
1 parent 980411c commit b918a1c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sage/libs/mpmath/ext_main.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,19 +983,18 @@ cdef class Context:
983983
TESTS::
984984
985985
sage: from mpmath import mp
986-
sage: mp.pretty = True
987986
sage: (x, T) = mp._convert_param(3)
988987
sage: (x, type(x).__name__, T)
989988
(3, 'int', 'Z')
990989
sage: (x, T) = mp._convert_param(2.5)
991990
sage: (x, type(x).__name__, T)
992991
(mpq(5,2), 'mpq', 'Q')
993992
sage: (x, T) = mp._convert_param(2.3)
994-
sage: (x, type(x).__name__, T)
995-
(2.3, 'mpf', 'R')
993+
sage: (str(x), type(x).__name__, T)
994+
('2.3', 'mpf', 'R')
996995
sage: (x, T) = mp._convert_param(2+3j)
997996
sage: (x, type(x).__name__, T)
998-
((2.0 + 3.0j), 'mpc', 'C')
997+
(mpc(real='2.0', imag='3.0'), 'mpc', 'C')
999998
sage: mp.pretty = False
1000999
"""
10011000
cdef MPF v

0 commit comments

Comments
 (0)