~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testsweet.py

  • Committer: Aaron Bentley
  • Date: 2005-09-19 02:33:09 UTC
  • mfrom: (1185.3.27)
  • mto: (1185.1.29)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050919023309-24e8871f7f8b31cf
Merged latest from mpool

Show diffs side-by-side

added added

removed removed

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