~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testsweet.py

  • Committer: Martin Pool
  • Date: 2005-09-05 05:35:25 UTC
  • mfrom: (974.1.55)
  • Revision ID: mbp@sourcefrog.net-20050905053525-2112bac069dbe331
- merge various bug fixes from aaron

aaron.bentley@utoronto.ca-20050905020131-a2d5b7711dd6cd98

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
    # XXX: Not used yet
57
57
 
58
58
 
 
59
 
59
60
class EarlyStoppingTestResultAdapter(object):
60
61
    """An adapter for TestResult to stop at the first first failure or error"""
61
62
 
89
90
    def startTest(self, test):
90
91
        unittest.TestResult.startTest(self, test)
91
92
        # TODO: Maybe show test.shortDescription somewhere?
92
 
        what = test.shortDescription() or test.id()        
 
93
        what = test.id()
 
94
        # python2.3 has the bad habit of just "runit" for doctests
 
95
        if what == 'runit':
 
96
            what = test.shortDescription()
93
97
        if self.showAll:
94
 
            self.stream.write('%-70.70s' % what)
 
98
            self.stream.write('%-60.60s' % what)
95
99
        self.stream.flush()
96
100
 
97
101
    def addError(self, test, err):
169
173
    # but only a little. Folk not using our testrunner will
170
174
    # have to delete their temp directories themselves.
171
175
    if result.wasSuccessful():
172
 
        if TestCaseInTempDir.TEST_ROOT is not None:
 
176
        if TestCaseInTempDir.TEST_ROOT:
173
177
            shutil.rmtree(TestCaseInTempDir.TEST_ROOT) 
174
178
    else:
175
179
        print "Failed tests working directories are in '%s'\n" % TestCaseInTempDir.TEST_ROOT