~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: Aaron Bentley
  • Date: 2005-09-11 03:39:37 UTC
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050911033937-d1eeb48f6e3472ed
Fixed selftest spewage (Brian M. Carlson)

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