doctest's ELLIPSIS

  • Thread starter =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
  • Start date
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

Hi,

Can anybody come up with a sensible argument that would explain
why the following test should fail ? (Expected: nothing, Got: 42).

cheers,

S.B.

----------------------------------------
#!/usr/bin/env python

import doctest

def test():
""" ...
"""

def run():
"Run the test."
doctest.testmod()

if __name__ == '__main__':
run()

----------------------------------------
 
M

Michele Simionato

I think doctest believes the line starting with ... is
a continuation line in a multiline statement.
 
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

Doh ! Obviously ... too bad.

I guess that I could set doctest.ELLIPSIS_MARKER to "[...]" to
distinguish
the two usages of "...". (The "..." used for multiline statements is
hard-coded
into a regular expression pattern).

But it feels too hackish, ELLIPSIS_MATKER being not described in the
docs ...

Well, anyway, thanks for your insight.

S.B.
 
M

Michele Simionato

I would file a bug report/documentation bug/feature
request or whatever to sourceforge.

Michele Simionato
 
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

(Forwarded from Python bug tracker)

[ 1192554 ] doctest's ELLIPSIS and multiline statements

Tim Peters:
[...]
doctest has few syntax requirements, but the
inability to start an expected output block with "..." has
always been one of them, and is independent of the
ELLIPSIS gimmick. I doubt this will change, in part because
the complications needed to "do something about it" are
probably pig ugly, in part because it's so rare a desire, and
in part because there are easy ways to work around it (like
arranging for the expected output to start with something
other than '...').
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top