Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctest's ELLIPSIS and multiline statements #41924

Closed
boisgerault mannequin opened this issue Apr 29, 2005 · 2 comments
Closed

doctest's ELLIPSIS and multiline statements #41924

boisgerault mannequin opened this issue Apr 29, 2005 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@boisgerault
Copy link
Mannequin

boisgerault mannequin commented Apr 29, 2005

BPO 1192554
Nosy @tim-one

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-04-29.17:52:43.000>
created_at = <Date 2005-04-29.17:36:31.000>
labels = ['library']
title = "doctest's ELLIPSIS and multiline statements"
updated_at = <Date 2005-04-29.17:52:43.000>
user = 'https://bugs.python.org/boisgerault'

bugs.python.org fields:

activity = <Date 2005-04-29.17:52:43.000>
actor = 'tim.peters'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2005-04-29.17:36:31.000>
creator = 'boisgerault'
dependencies = []
files = []
hgrepos = []
issue_num = 1192554
keywords = []
message_count = 2.0
messages = ['25179', '25180']
nosy_count = 2.0
nosy_names = ['tim.peters', 'boisgerault']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1192554'
versions = []

@boisgerault
Copy link
Mannequin Author

boisgerault mannequin commented Apr 29, 2005

The doctest ELLPSIS marker (default: "...") may be
confused by the doctest parser with the multiline
statement marker ("...").

Example: in the following code, the intent was to accept
any result after "print 42". This is NOT a multiline
statement,
but however the test fails (Expected: nothing, Got: 42).

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

import doctest

def test():
    """
    >>> print 42 #doctest: +ELLIPSIS
    ...
    """

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

if __name__ == '__main__':
    run()

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

@boisgerault boisgerault mannequin closed this as completed Apr 29, 2005
@boisgerault boisgerault mannequin added the stdlib Python modules in the Lib dir label Apr 29, 2005
@boisgerault boisgerault mannequin closed this as completed Apr 29, 2005
@boisgerault boisgerault mannequin added the stdlib Python modules in the Lib dir label Apr 29, 2005
@tim-one
Copy link
Member

tim-one commented Apr 29, 2005

Logged In: YES
user_id=31435

That's true. 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 '...').

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant