~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Martin
  • Date: 2010-09-15 15:24:12 UTC
  • mto: This revision was merged to the branch mainline in revision 5430.
  • Revision ID: gzlist@googlemail.com-20100915152412-ywsg07hbvyf0rh8d
Remove unneeded log cleanup method and calls, and redundant progress bar clearing

Show diffs side-by-side

added added

removed removed

Lines of Context:
319
319
        """Record that a test has started."""
320
320
        self._start_time = time.time()
321
321
 
322
 
    def _cleanupLogFile(self, test):
323
 
        # We can only do this if we have one of our TestCases, not if
324
 
        # we have a doctest.
325
 
        setKeepLogfile = getattr(test, 'setKeepLogfile', None)
326
 
        if setKeepLogfile is not None:
327
 
            setKeepLogfile()
328
 
 
329
322
    def addError(self, test, err):
330
323
        """Tell result that test finished with an error.
331
324
 
338
331
        self.report_error(test, err)
339
332
        if self.stop_early:
340
333
            self.stop()
341
 
        self._cleanupLogFile(test)
342
334
 
343
335
    def addFailure(self, test, err):
344
336
        """Tell result that test failed.
352
344
        self.report_failure(test, err)
353
345
        if self.stop_early:
354
346
            self.stop()
355
 
        self._cleanupLogFile(test)
356
347
 
357
348
    def addSuccess(self, test, details=None):
358
349
        """Tell result that test completed successfully.
366
357
                    self._formatTime(benchmark_time),
367
358
                    test.id()))
368
359
        self.report_success(test)
369
 
        self._cleanupLogFile(test)
370
360
        super(ExtendedTestResult, self).addSuccess(test)
371
361
        test._log_contents = ''
372
362
 
487
477
        super(TextTestResult, self).startTestRun()
488
478
        self.pb.update('[test 0/%d] Starting' % (self.num_tests))
489
479
 
490
 
    def printErrors(self):
491
 
        # clear the pb to make room for the error listing
492
 
        self.pb.clear()
493
 
        super(TextTestResult, self).printErrors()
494
 
 
495
480
    def _progress_prefix_text(self):
496
481
        # the longer this text, the less space we have to show the test
497
482
        # name...