~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to testsweet.py

Nathaniel McCallums patch for urandom friendliness on aix.

Show diffs side-by-side

added added

removed removed

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