~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_log.py

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 17:48:22 UTC
  • mto: (4987.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125174822-nce4l19sbwx83jvq
Deploying the new overrideAttr facility further reduces the complexity
and make the code clearer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
                # Always return our own log formatter
78
78
                return self.log_catcher
79
79
 
80
 
        self.addAttrCleanup(log.log_formatter_registry, 'get_default')
81
80
        def getme(branch):
82
81
                # Always return our own log formatter class hijacking the
83
82
                # default behavior (which requires setting up a config
84
83
                # variable)
85
84
            return MyLogFormatter
86
 
        log.log_formatter_registry.get_default = getme
 
85
        self.overrideAttr(log.log_formatter_registry, 'get_default', getme)
87
86
 
88
87
    def get_captured_revisions(self):
89
88
        return self.log_catcher.revisions
607
606
 
608
607
    def setUp(self):
609
608
        super(TestLogEncodings, self).setUp()
610
 
        self.addAttrCleanup(osutils, '_cached_user_encoding')
 
609
        self.overrideAttr(osutils, '_cached_user_encoding')
611
610
 
612
611
    def create_branch(self):
613
612
        bzr = self.run_bzr