~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2009-11-27 10:43:47 UTC
  • mfrom: (4815.3.8 quiet-serve)
  • mto: This revision was merged to the branch mainline in revision 4832.
  • Revision ID: v.ladeuil+lp@free.fr-20091127104347-s0z0ma2f7mbpd660
Make server --quiet really quiet

Show diffs side-by-side

added added

removed removed

Lines of Context:
1836
1836
            os.chdir(working_dir)
1837
1837
 
1838
1838
        try:
1839
 
            result = self.apply_redirected(ui.ui_factory.stdin,
1840
 
                stdout, stderr,
1841
 
                bzrlib.commands.run_bzr_catch_user_errors,
1842
 
                args)
 
1839
            try:
 
1840
                result = self.apply_redirected(ui.ui_factory.stdin,
 
1841
                    stdout, stderr,
 
1842
                    bzrlib.commands.run_bzr_catch_user_errors,
 
1843
                    args)
 
1844
            except KeyboardInterrupt:
 
1845
                # Reraise KeyboardInterrupt with contents of redirected stdout
 
1846
                # and stderr as arguments, for tests which are interested in
 
1847
                # stdout and stderr and are expecting the exception.
 
1848
                out = stdout.getvalue()
 
1849
                err = stderr.getvalue()
 
1850
                if out:
 
1851
                    self.log('output:\n%r', out)
 
1852
                if err:
 
1853
                    self.log('errors:\n%r', err)
 
1854
                raise KeyboardInterrupt(out, err)
1843
1855
        finally:
1844
1856
            logger.removeHandler(handler)
1845
1857
            ui.ui_factory = old_ui_factory