~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Martin Pool
  • Date: 2005-06-24 05:34:25 UTC
  • Revision ID: mbp@sourcefrog.net-20050624053425-6fab66f10cf619f4
- log messages from a particular test are printed if that test fails

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
    OVERRIDE_PYTHON = None # to run with alternative python 'python'
44
44
    BZRPATH = 'bzr'
45
 
    
 
45
 
 
46
    _log_buf = ""
 
47
 
46
48
 
47
49
    def formcmd(self, cmd):
48
50
        if isinstance(cmd, basestring):
116
118
 
117
119
    def log(self, msg):
118
120
        """Log a message to a progress file"""
 
121
        self._log_buf = self._log_buf + str(msg) + '\n'
119
122
        print >>self.TEST_LOG, msg
 
123
        
120
124
               
121
125
 
122
126
class InTempDir(TestBase):
268
272
     if desc:
269
273
         print '   (%s)' % desc
270
274
     print tb
 
275
 
 
276
     if isinstance(case, TestBase):
 
277
         print
 
278
         print 'log from this test:'
 
279
         print case._log_buf
 
280
         
271
281
     print ''.ljust(60, '-')
272
282
    
 
283