~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2005-08-25 08:19:55 UTC
  • Revision ID: mbp@sourcefrog.net-20050825081955-d7295021dcfcd2ba
- disable standard logging to .bzr.log and stderr while running 
  tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import os
32
32
 
33
33
import bzrlib
 
34
import bzrlib.trace
34
35
from bzrlib.trace import mutter, note, log_error, warning
35
36
from bzrlib.errors import BzrError, BzrCheckError, BzrCommandError
36
37
from bzrlib.branch import find_branch
1408
1409
        from bzrlib.selftest import selftest
1409
1410
 
1410
1411
        # we don't want progress meters from the tests to go to the
1411
 
        # real output.
 
1412
        # real output; and we don't want log messages cluttering up
 
1413
        # the real logs.
1412
1414
 
1413
1415
        save_ui = bzrlib.ui.ui_factory
 
1416
        bzrlib.trace.info('running tests...')
 
1417
        bzrlib.trace.disable_default_logging()
1414
1418
        try:
1415
1419
            bzrlib.ui.ui_factory = bzrlib.ui.SilentUIFactory()
1416
 
            return int(not selftest(verbose=verbose))
 
1420
            result = selftest(verbose=verbose)
 
1421
            if result:
 
1422
                bzrlib.trace.info('tests passed')
 
1423
            else:
 
1424
                bzrlib.trace.info('tests failed')
 
1425
            return int(not result)
1417
1426
        finally:
 
1427
            bzrlib.trace.enable_default_logging()
1418
1428
            bzrlib.ui.ui_factory = save_ui
1419
1429
 
1420
1430