Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7376] FAIL: Doctest: __main__.DebugRunner

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 22, 2009, 9:57 AM

Post #1 of 3 (212 views)
Permalink
[issue7376] FAIL: Doctest: __main__.DebugRunner

New submission from flox <laxyf [at] yahoo>:

Running on Debian Lenny, with Python 3.1.
The Python 2.5 version is OK.

~ $ python3 --version
Python 3.1.1+
~ $ python3 -m doctest
F..............
======================================================================
FAIL: Doctest: __main__.DebugRunner
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.1/doctest.py", line 2096, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for __main__.DebugRunner
File "/usr/lib/python3.1/doctest.py", line 1644, in DebugRunner

----------------------------------------------------------------------
File "/usr/lib/python3.1/doctest.py", line 1712, in __main__.DebugRunner
Failed example:
runner.run(test)
Expected:
Traceback (most recent call last):
...
doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>
Got:
Traceback (most recent call last):
File "/usr/lib/python3.1/doctest.py", line 1243, in __run
compileflags, 1), test.globs)
File "<doctest __main__.DebugRunner[15]>", line 1, in <module>
runner.run(test)
File "/usr/lib/python3.1/doctest.py", line 1736, in run
r = DocTestRunner.run(self, test, compileflags, out, False)
File "/usr/lib/python3.1/doctest.py", line 1375, in run
return self.__run(test, compileflags, out)
File "/usr/lib/python3.1/doctest.py", line 1296, in __run
exception)
File "/usr/lib/python3.1/doctest.py", line 1742, in
report_unexpected_exception
raise UnexpectedException(test, example, exc_info)
UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>


----------------------------------------------------------------------
Ran 15 tests in 0.015s

FAILED (failures=1)
~ $

----------
components: Library (Lib), Tests
messages: 95605
nosy: flox
severity: normal
status: open
title: FAIL: Doctest: __main__.DebugRunner
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7376>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 22, 2009, 8:19 PM

Post #2 of 3 (187 views)
Permalink
[issue7376] FAIL: Doctest: __main__.DebugRunner [In reply to]

Alexander Belopolsky <belopolsky [at] users> added the comment:

Apparently this was introduced with r51625 :

r51625 | guido.van.rossum | 2006-08-26 16:37:44 -0400 (Sat, 26 Aug 2006)
| 4 lines

Inspired by SF patch #860326, make the exception formatting by
traceback.py be closer to the built-in formatting.
A few unittests had to be fixed, too.

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


When doctest is imported as __main__, traceback does not prepend
UnexpectedException with doctest. prefix. Attached patch fixes the
issue by explicitly reimporting doctest in the 'if __name__ ==
"__main__":' clause.

This is rather inelegant and a better solution would probably be to use
python -m doctest for something other than self test. For example,
running doctest.testfile on command line arguments would be a reasonable
use, but python -m doctest Lib/doctest.py may still have a problem.

----------
keywords: +patch
nosy: +belopolsky
Added file: http://bugs.python.org/file15380/issue7376.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7376>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 23, 2009, 2:32 AM

Post #3 of 3 (181 views)
Permalink
[issue7376] FAIL: Doctest: __main__.DebugRunner [In reply to]

R. David Murray <rdmurray [at] bitdance> added the comment:

python -m doctest does accept file arguments. Running the self-test is
the default if no arguments are supplied.

python -m doctest Lib/doctest.py passes.

So perhaps we should just remove the default and instead issue an error
message about missing arguments.

----------
nosy: +r.david.murray
priority: -> low
type: -> behavior

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7376>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.