#3557: Preparser bug: doctest failes when "..." is first expected output
----------------------------+----------------------------------------------
Reporter: mabshoff | Owner: was
Type: defect | Status: closed
Priority: critical | Milestone: sage-duplicate/invalid/wontfix
Component: doctest | Resolution: invalid
coverage | Merged in:
Keywords: | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | Stopgaps:
Dependencies: |
----------------------------+----------------------------------------------
Changes (by chapoton):
* upstream: => N/A
Old description:
> With
> {{{
> EXAMPLES:
> sage: G = DirichletGroup(3)
> sage: e = G.0
> sage: e.gauss_sum_numerical()
> ...e-16 + 1.7320508075...*I
> }}}
> the doctesting framework complains about:
> {{{
> sage -t -long devel/sage/sage/modular/dirichlet.py Traceback
> (most recent call last):
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/tmp/.doctest_dirichlet.py", line 1206, in
> <module>
> globs=globals())
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 1814, in
> testmod
> for test in finder.find(m, name, globs=globs, extraglobs=extraglobs):
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 839, in
> find
> self._find(tests, obj, name, module, source_lines, globs, {})
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 893, in
> _find
> globs, seen)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 881, in
> _find
> test = self._get_test(obj, name, module, globs, source_lines)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 965, in
> _get_test
> filename, lineno)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 594, in
> get_doctest
> return DocTest(self.get_examples(string, name), globs,
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 608, in
> get_examples
> return [x for x in self.parse(string, name)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 570, in
> parse
> self._parse_example(m, name, lineno)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 628, in
> _parse_example
> self._check_prompt_blank(source_lines, indent, name, lineno)
> File "/scratch/mabshoff/release-
> cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 715, in
> _check_prompt_blank
> line[indent:indent+3], line))
> ValueError: line 24 of the docstring for __main__.example_23 lacks blank
> after ...: " ...e-Integer(16) +
> RealNumber('1.7320508075E')llipsis*I"
>
> [2.5 s]
> exit code: 1024
> }}}
> According to wstein this is a bug in the preparser.
>
> Cheers,
>
> Michael
New description:
With
{{{
EXAMPLES:
sage: G = DirichletGroup(3)
sage: e = G.0
sage: e.gauss_sum_numerical()
...e-16 + 1.7320508075...*I
}}}
the doctesting framework complains about:
{{{
sage -t -long devel/sage/sage/modular/dirichlet.py Traceback
(most recent call last):
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/tmp/.doctest_dirichlet.py", line 1206, in <module>
globs=globals())
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 1814, in
testmod
for test in finder.find(m, name, globs=globs, extraglobs=extraglobs):
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 839, in find
self._find(tests, obj, name, module, source_lines, globs, {})
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 893, in
_find
globs, seen)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 881, in
_find
test = self._get_test(obj, name, module, globs, source_lines)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 965, in
_get_test
filename, lineno)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 594, in
get_doctest
return DocTest(self.get_examples(string, name), globs,
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 608, in
get_examples
return [x for x in self.parse(string, name)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 570, in
parse
self._parse_example(m, name, lineno)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 628, in
_parse_example
self._check_prompt_blank(source_lines, indent, name, lineno)
File "/scratch/mabshoff/release-
cycle/sage-3.0.4.alpha2/local/lib/python2.5/doctest.py", line 715, in
_check_prompt_blank
line[indent:indent+3], line))
ValueError: line 24 of the docstring for __main__.example_23 lacks blank
after ...: " ...e-Integer(16) +
RealNumber('1.7320508075E')llipsis*I"
[2.5 s]
exit code: 1024
}}}
According to wstein this is a bug in the preparser.
Cheers,
Michael
--
--
Ticket URL: <http://trac.sagemath.org/ticket/3557#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.