/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Martin Pool
  • Date: 2010-02-09 19:04:02 UTC
  • mfrom: (5010 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5019.
  • Revision ID: mbp@canonical.com-20100209190402-2xbzrchmb4dfi2j7
Resolve conflicts with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
253
253
        # If _open_bzr_log cannot open the file, then we should write the
254
254
        # warning to stderr. Since this is normally happening before logging is
255
255
        # set up.
256
 
        self.addCleanup(setattr, sys, 'stderr', sys.stderr)
257
 
        self.addCleanup(setattr, trace, '_bzr_log_filename',
258
 
                        trace._bzr_log_filename)
259
 
        sys.stderr = StringIO()
 
256
        self.overrideAttr(sys, 'stderr', StringIO())
260
257
        # Set the log file to something that cannot exist
 
258
        # FIXME: A bit dangerous: we are not in an isolated dir here -- vilajam
 
259
        # 20100125
261
260
        os.environ['BZR_LOG'] = os.getcwd() + '/no-dir/bzr.log'
 
261
        self.overrideAttr(trace, '_bzr_log_filename')
262
262
        logf = trace._open_bzr_log()
263
263
        self.assertIs(None, logf)
264
264
        self.assertContainsRe(sys.stderr.getvalue(),
265
265
                              'failed to open trace file: .*/no-dir/bzr.log')
266
266
 
 
267
 
267
268
class TestVerbosityLevel(TestCase):
268
269
 
269
270
    def test_verbosity_level(self):