forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-38776: Fix test failures due to global mpmath state
mpmath has a global `mp.pretty` variable that affects how its numbers are printed. On my machine, it's not reliable. For example: ``` Failed example: repr(mp.mpc(2,3)) Expected: '(2.0 + 3.0j)' Got: "mpc(real='2.0', imag='3.0')" ``` I've only fixed the tests that are failing for me, since mpmath-1.4 is on the TODO list. A few different strategies are used: * `print()` will use the pretty format if all we're doing is displaying an answer. * `with workdps` can be used to change the precision only locally. * In TESTS blocks, the ugly output is acceptable. * When actually testing `mp.pretty`, we can first clone the `mp` object with `mp2 = mp.clone()`, and then work on the new one. URL: sagemath#38776 Reported by: Michael Orlitzky Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
2 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters