classification
Title: a fix for doctest crash when it is ran on itself
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: tim_one Nosy List: isandler, mdehoon, tim_one
Priority: normal Keywords: patch

Created on 2005-03-21 06:05 by isandler, last changed 2005-03-28 23:52 by tim_one. This issue is now closed.

Files
File name Uploaded Description Edit
doctest.py.patch isandler, 2005-03-21 06:05
Messages (3)
msg48023 - (view) Author: Ilya Sandler (isandler) Date: 2005-03-21 06:05
When doctest.py is ran without arguments, it runs its
own docs
through itself and crashes with:

bagira:~/python/dist/src/Lib> ../python doctest1.121.py
...............F
======================================================================
FAIL: Doctest: __main__.set_unittest_reportflags
----------------------------------------------------------------------
Traceback (most recent call last):
  File "doctest1.121.py", line 2152, in runTest
    raise
self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for
__main__.set_unittest_reportflags
  File "doctest1.121.py", line 2068, in
set_unittest_reportflags

----------------------------------------------------------------------
File "doctest1.121.py", line 2080, in
__main__.set_unittest_reportflags
Failed example:
    doctest._unittest_reportflags == (REPORT_NDIFF |
                                     
REPORT_ONLY_FIRST_FAILURE)
Expected:
    True
Got:
    False


----------------------------------------------------------------------
Ran 16 tests in 0.080s

FAILED (failures=1)

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

The attached patch fixes the problem...
msg48024 - (view) Author: Michiel de Hoon (mdehoon) Date: 2005-03-27 06:03
Logged In: YES 
user_id=488897

I tested this patch and found that it works OK. I'll write
to python-dev in support of this patch.
--Michiel.
msg48025 - (view) Author: Tim Peters (tim_one) * (Python committer) Date: 2005-03-28 23:52
Logged In: YES 
user_id=31435

Thanks!  Patch applied, Lib/doctest.py rev 1.122
History
Date User Action Args
2005-03-21 06:05:49isandlercreate