[New-bugs-announce] [issue4657] Doctest gets line numbers wrongs with <> in name

Nick Coghlan report at bugs.python.org
Sun Dec 14 09:21:26 CET 2008


New submission from Nick Coghlan <ncoghlan at gmail.com>:

When writing the unit tests for running doctests from inside a zipfile,
I initially had "<anon>" as the name being passed to the
doctest.DocTestFinder.find method.

With that name, the line numbers coming back for all of the examples
were being incremented by 1 beyond what test_doctest expected (and hence
my tests were failing).

Changing the name to "anon" eliminated the errors. (Both "<anon" and
"anon>" also failed in the same fashion as "<anon>")

I suspect there may be a problem with __LINECACHE_FILENAME_RE when "<"
or ">" are embedded in the name used for the doctest execution.

----------
messages: 77777
nosy: ncoghlan
severity: normal
status: open
title: Doctest gets line numbers wrongs with <> in name

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4657>
_______________________________________


More information about the New-bugs-announce mailing list