def __init__(self, filename): self.parser = doctest.DocTestParser() self.retval = 0 self._filename = filename self._default_duration = 0.01 self._prompt = False self._interact = False self._pos = 0 self._windows = {} self._ns = {} self._source_id = -1 self._stmts = self.parser.get_examples(open(filename).read()) self._checker = doctest.OutputChecker() # Create a fake output target for capturing doctest output. self._fakeout = _SpoofOut() self._stdout = sys.stdout self._options = (doctest.ELLIPSIS | doctest.REPORT_ONLY_FIRST_FAILURE | doctest.REPORT_UDIFF) self._updateFile = False self._caughtExceptions = [] # list of (exception,traceback) pairs wi = WidgetIntrospecter() wi.register_event_handler() wi.connect('window-added', self._on_wi__window_added) wi.connect('window-removed', self._on_wi__window_removed)
def __init__(self, filename): self.parser = doctest.DocTestParser() self.retval = 0 self._filename = filename self._pos = 0 self._windows = {} self._ns = {} self._source_id = -1 self._stmts = self.parser.get_examples(open(filename).read()) self._checker = doctest.OutputChecker() # Create a fake output target for capturing doctest output. self._fakeout = _SpoofOut() self._options = doctest.ELLIPSIS | doctest.REPORT_ONLY_FIRST_FAILURE wi = WidgetIntrospecter() wi.register_event_handler() wi.connect('window-added', self._on_wi__window_added) wi.connect('window-removed', self._on_wi__window_removed)