~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert Collins
  • Date: 2006-05-04 13:46:51 UTC
  • mto: (1697.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: robertc@robertcollins.net-20060504134651-e6ced8954d74a342
Teach TestCase.run_bzr_captured about the ui factories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
        handler.setLevel(logging.INFO)
475
475
        logger = logging.getLogger('')
476
476
        logger.addHandler(handler)
 
477
        old_stdin = getattr(bzrlib.ui.ui_factory, "stdin", None)
 
478
        bzrlib.ui.ui_factory.stdin = stdin
477
479
        try:
478
480
            result = self.apply_redirected(stdin, stdout, stderr,
479
481
                                           bzrlib.commands.run_bzr_catch_errors,
480
482
                                           argv)
481
483
        finally:
482
484
            logger.removeHandler(handler)
 
485
            bzrlib.ui.ui_factory.stdin = old_stdin
483
486
        out = stdout.getvalue()
484
487
        err = stderr.getvalue()
485
488
        if out: