Django

Code

Changeset 6851

Show
Ignore:
Timestamp:
12/02/07 15:03:53 (9 months ago)
Author:
jacob
Message:

Fixed #6024: Django's doctest no longer clashes with coverage.py. Thanks to Ned Batchelder for the original fix, and Todd O'Brian for his update to make it work with Django.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/test/_doctest.py

    r6194 r6851  
    355355    def __init__(self, out): 
    356356        self.__out = out 
     357        self.__debugger_used = False 
    357358        pdb.Pdb.__init__(self) 
     359 
     360    def set_trace(self): 
     361        self.__debugger_used = True 
     362        pdb.Pdb.set_trace(self) 
     363 
     364    def set_continue(self): 
     365        # Calling set_continue unconditionally would break unit test coverage 
     366        # reporting, as Bdb.set_continue calls sys.settrace(None). 
     367        if self.__debugger_used: 
     368            pdb.Pdb.set_continue(self) 
    358369 
    359370    def trace_dispatch(self, *args):