[Pkg-bazaar-commits] ./bzr/unstable r764: - log messages from a particular test are printed if that test fails

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:13:44 UTC 2009


------------------------------------------------------------
revno: 764
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Fri 2005-06-24 15:34:25 +1000
message:
  - log messages from a particular test are printed if that test fails
modified:
  bzrlib/selftest/__init__.py
-------------- next part --------------
=== modified file 'bzrlib/selftest/__init__.py'
--- a/bzrlib/selftest/__init__.py	2005-06-22 08:08:10 +0000
+++ b/bzrlib/selftest/__init__.py	2005-06-24 05:34:25 +0000
@@ -42,7 +42,9 @@
 
     OVERRIDE_PYTHON = None # to run with alternative python 'python'
     BZRPATH = 'bzr'
-    
+
+    _log_buf = ""
+
 
     def formcmd(self, cmd):
         if isinstance(cmd, basestring):
@@ -116,7 +118,9 @@
 
     def log(self, msg):
         """Log a message to a progress file"""
+        self._log_buf = self._log_buf + str(msg) + '\n'
         print >>self.TEST_LOG, msg
+        
                
 
 class InTempDir(TestBase):
@@ -268,5 +272,12 @@
      if desc:
          print '   (%s)' % desc
      print tb
+
+     if isinstance(case, TestBase):
+         print
+         print 'log from this test:'
+         print case._log_buf
+         
      print ''.ljust(60, '-')
     
+



More information about the Pkg-bazaar-commits mailing list