Ticket #6024: doctest_patch_for_coverage_py-r6777.diff

File doctest_patch_for_coverage_py-r6777.diff, 1.0 KB (added by Todd O'Bryan, 16 years ago)
  • django/test/_doctest.py

    Property changes on: .
    ___________________________________________________________________
    Name: svn:ignore
       - build
    dist
    *.egg-info
    MANIFEST
    *.pyc
    
       + build
    dist
    *.egg-info
    MANIFEST
    *.pyc
    .project
    .pydevproject
    
    
     
    354354    """
    355355    def __init__(self, out):
    356356        self.__out = out
     357        self.__debugger_used = False
    357358        pdb.Pdb.__init__(self)
    358359
     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)
     369
     370
    359371    def trace_dispatch(self, *args):
    360372        # Redirect stdout to the given stream.
    361373        save_stdout = sys.stdout
Back to Top