Rev 5430: (spiv) Remove some code in bzrlib/tests/__init__.py that is no longer used. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Sep 16 08:04:38 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5430 [merge]
revision-id: pqm at pqm.ubuntu.com-20100916070436-jm5qh2fgacocasc4
parent: pqm at pqm.ubuntu.com-20100916054547-2zydmfmm1wsux8xj
parent: andrew.bennetts at canonical.com-20100916031753-fsdpj4aoqd0g2t61
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-09-16 08:04:36 +0100
message:
  (spiv) Remove some code in bzrlib/tests/__init__.py that is no longer used.
   (Andrew Bennetts)
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2010-09-14 09:29:57 +0000
+++ b/bzrlib/tests/__init__.py	2010-09-16 03:17:53 +0000
@@ -36,7 +36,6 @@
 import errno
 import itertools
 import logging
-import math
 import os
 import platform
 import pprint
@@ -72,7 +71,6 @@
     lock as _mod_lock,
     memorytree,
     osutils,
-    progress,
     ui,
     urlutils,
     registry,
@@ -319,13 +317,6 @@
         """Record that a test has started."""
         self._start_time = time.time()
 
-    def _cleanupLogFile(self, test):
-        # We can only do this if we have one of our TestCases, not if
-        # we have a doctest.
-        setKeepLogfile = getattr(test, 'setKeepLogfile', None)
-        if setKeepLogfile is not None:
-            setKeepLogfile()
-
     def addError(self, test, err):
         """Tell result that test finished with an error.
 
@@ -338,7 +329,6 @@
         self.report_error(test, err)
         if self.stop_early:
             self.stop()
-        self._cleanupLogFile(test)
 
     def addFailure(self, test, err):
         """Tell result that test failed.
@@ -352,7 +342,6 @@
         self.report_failure(test, err)
         if self.stop_early:
             self.stop()
-        self._cleanupLogFile(test)
 
     def addSuccess(self, test, details=None):
         """Tell result that test completed successfully.
@@ -366,7 +355,6 @@
                     self._formatTime(benchmark_time),
                     test.id()))
         self.report_success(test)
-        self._cleanupLogFile(test)
         super(ExtendedTestResult, self).addSuccess(test)
         test._log_contents = ''
 
@@ -487,11 +475,6 @@
         super(TextTestResult, self).startTestRun()
         self.pb.update('[test 0/%d] Starting' % (self.num_tests))
 
-    def printErrors(self):
-        # clear the pb to make room for the error listing
-        self.pb.clear()
-        super(TextTestResult, self).printErrors()
-
     def _progress_prefix_text(self):
         # the longer this text, the less space we have to show the test
         # name...
@@ -823,7 +806,7 @@
     routine, and to build and check bzr trees.
 
     In addition to the usual method of overriding tearDown(), this class also
-    allows subclasses to register functions into the _cleanups list, which is
+    allows subclasses to register cleanup functions via addCleanup, which are
     run in order as the object is torn down.  It's less likely this will be
     accidentally overlooked.
     """
@@ -834,7 +817,6 @@
 
     def __init__(self, methodName='testMethod'):
         super(TestCase, self).__init__(methodName)
-        self._cleanups = []
         self._directory_isolation = True
         self.exception_handlers.insert(0,
             (UnavailableFeature, self._do_unsupported_or_skip))
@@ -1498,14 +1480,6 @@
         """
         debug.debug_flags.discard('strict_locks')
 
-    def addCleanup(self, callable, *args, **kwargs):
-        """Arrange to run a callable when this case is torn down.
-
-        Callables are run in the reverse of the order they are registered,
-        ie last-in first-out.
-        """
-        self._cleanups.append((callable, args, kwargs))
-
     def overrideAttr(self, obj, attr_name, new=_unitialized_attr):
         """Overrides an object attribute restoring it after the test.
 




More information about the bazaar-commits mailing list