~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2005-11-18 16:34:28 UTC
  • mto: (1185.50.19 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1512.
  • Revision ID: john@arbash-meinel.com-20051118163428-498977103afee28e
Shorten test names in verbose mode in a logical way. Removed bzrlib.selftest prefix

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
 
77
77
    def startTest(self, test):
78
78
        unittest.TestResult.startTest(self, test)
79
 
        # TODO: Maybe show test.shortDescription somewhere?
80
 
        what = test.shortDescription() or test.id()        
 
79
        # In a short description, the important words are in
 
80
        # the beginning, but in an id, the important words are
 
81
        # at the end
 
82
        what = test.shortDescription()
 
83
        if what:
 
84
            if len(what) > 70:
 
85
                what = what[:67] + '...'
 
86
        else:
 
87
            what = test.id()
 
88
            if what.startswith('bzrlib.selftest.'):
 
89
                what = what[16:]
 
90
            if len(what) > 70:
 
91
                what = '...' + what[-67:]
 
92
            
81
93
        if self.showAll:
82
94
            self.stream.write('%-70.70s' % what)
83
95
        self.stream.flush()