473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

doctest's ELLIPSIS

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():
"""
print 42 #doctest: +ELLIPSIS

...
"""

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

if __name__ == '__main__':
run()

----------------------------------------

Jul 19 '05 #1
5 2418
I think doctest believes the line starting with ... is
a continuation line in a multiline statement.

Jul 19 '05 #2

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.

Jul 19 '05 #3
I would file a bug report/documentation bug/feature
request or whatever to sourceforge.

Michele Simionato

Jul 19 '05 #4
Done.

Jul 19 '05 #5
(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 '...').

Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David MacKay | last post by:
Hello, I'm a python-list newbie. I've got a question about doctest; perhaps a bug report. I really like doctest, but sometimes doctest gives a failure when the output looks absolutely fine to me...
0
by: Leo | last post by:
Could someone please spare a .i file with an example doctest that works? I tried as follows and it fails: 1) I have an osi.i file that generates osi.py and _osi.so. At the very end I added:...
3
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ tests.py?rev=89831&view=auto test file, there is this doctests : def develop_verbose(): """ We should be able to...
0
by: dj | last post by:
Hello, I have just started working with minimock in doctest. I want to create a mock pyodbc object which returns a string value when the method execute is called. Here is my doctest: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.