This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Commit 5ba3c41
Release Manager
Trac #31036: fixdoctests fails on multiline tests
{{{#!diff
diff --git a/src/sage/geometry/polyhedron/backend_normaliz.py
b/src/sage/geometry/polyhedron/backend_normaliz.py
index f47d07f..eb01e1740c 100644
--- a/src/sage/geometry/polyhedron/backend_normaliz.py
+++ b/src/sage/geometry/polyhedron/backend_normaliz.py
@@ -103,7 +103,8 @@ class Polyhedron_normaliz(Polyhedron_base):
EXAMPLES::
sage: p = Polyhedron(vertices=[(0,0),(1,0),(0,1)],
rays=[(1,1)], # optional - pynormaliz
- ....: lines=[], backend='normaliz')
+ A 2-dimensional polyhedron in QQ^2 defined as the convex hull
of 3 vertices and 1 ray
+ ....: lines=[], backend='normaliz'); p
sage: TestSuite(p).run()
# optional - pynormaliz
}}}
I just added the printing of `p` and run `sage --fixdoctests`.
`fixdoctests` assumed that all tests have only one line so far.
In addition we now fix error testing according to our conventions:
Before running `fixdoctests`
{{{#!diff
EXAMPLES::
+ sage: raise ValueError
sage: rt2 = AA(sqrt(2)); rt2
1.414213562373095?
sage: rt3 = AA(sqrt(3)); rt3
}}}
After running `fixdoctests`:
{{{#!diff
EXAMPLES::
+ sage: raise ValueError
+ Traceback (most recent call last):
+ ...
+ ValueError
sage: rt2 = AA(sqrt(2)); rt2
1.414213562373095?
sage: rt3 = AA(sqrt(3)); rt3
}}}
Before running `fixdoctests`:
{{{
+ sage: raise TypeError("the error has changed")
+ Traceback (most recent call last):
+ ...
+ ValueError
}}}
After runninng `fixdoctests`:
{{{#!diff
EXAMPLES::
+ sage: raise TypeError("the error has changed")
+ Traceback (most recent call last):
+ ...
+ TypeError: the error has changed
sage: rt2 = AA(sqrt(2)); rt2
1.414213562373095?
sage: rt3 = AA(sqrt(3)); rt3
}}}
If a non-empty doctest raises an error after changes, then `fixdoctests`
needs to run twice (probably not very likely usecase).
URL: https://trac.sagemath.org/31036
Reported by: gh-kliem
Ticket author(s): Jonathan Kliem
Reviewer(s): Markus Wageringel1 file changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
71 | 82 | | |
72 | 83 | | |
73 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
74 | 90 | | |
75 | 91 | | |
76 | 92 | | |
| |||
0 commit comments