~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

merge up with HEAD and with test-fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
        
75
75
        self._log_file_name = name
76
76
 
 
77
    def run(self, result):
 
78
        self.apply_redirected(None, None, None,
 
79
                              unittest.TestCase.run, self, result)
77
80
        
78
81
    def tearDown(self):
79
82
        logging.getLogger('').removeHandler(self._log_hdlr)
138
141
        if stdin is None:
139
142
            stdin = StringIO("")
140
143
        if stdout is None:
141
 
            stdout = self._log_file
 
144
            if hasattr(self, "_log_file"):
 
145
                stdout = self._log_file
 
146
            else:
 
147
                stdout = StringIO()
142
148
        if stderr is None:
143
 
            stderr = self._log_file
 
149
            if hasattr(self, "_log_file"):
 
150
                stderr = self._log_file
 
151
            else:
 
152
                stderr = StringIO()
144
153
        real_stdin = sys.stdin
145
154
        real_stdout = sys.stdout
146
155
        real_stderr = sys.stderr
324
333
                   'bzrlib.selftest.test_xml',
325
334
                   'bzrlib.fetch',
326
335
                   'bzrlib.selftest.teststore',
 
336
                   'bzrlib.selftest.testgraph',
327
337
                   ]
328
338
 
329
339
    for m in (bzrlib.store, bzrlib.inventory, bzrlib.branch,