~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

- make TestCase._get_log work even if setup was aborted

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
    routine, and to build and check bzr trees."""
149
149
 
150
150
    BZRPATH = 'bzr'
 
151
    _log_file_name = None
151
152
 
152
153
    def setUp(self):
153
154
        unittest.TestCase.setUp(self)
182
183
 
183
184
    def _get_log(self):
184
185
        """Return as a string the log for this test"""
185
 
        return open(self._log_file_name).read()
186
 
 
 
186
        if self._log_file_name:
 
187
            return open(self._log_file_name).read()
 
188
        else:
 
189
            return ''
187
190
 
188
191
    def capture(self, cmd):
189
192
        """Shortcut that splits cmd into words, runs, and returns stdout"""