~jeanfrancois.roy/bzr/url-safe-escape

« back to all changes in this revision

Viewing changes to testsweet.py

  • Committer: Robert Collins
  • Date: 2005-09-27 07:24:40 UTC
  • mfrom: (1185.1.41)
  • Revision ID: robertc@robertcollins.net-20050927072440-1bf4d99c3e1db5b3
pair programming worx... merge integration and weave

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