tester.run()
###
+class _Display(object):
+ def __init__(self, display, provider, maxFailures):
+ self.display = display
+ self.maxFailures = maxFailures or object()
+ self.failedCount = 0
+ def update(self, test):
+ self.display.update(test)
+ self.failedCount += (test.result.code == lit.Test.FAIL)
+ if self.failedCount == self.maxFailures:
+ provider.cancel()
def handleFailures(provider, consumer, maxFailures):
- class _Display(object):
- def __init__(self, display):
- self.display = display
- self.maxFailures = maxFailures or object()
- self.failedCount = 0
- def update(self, test):
- self.display.update(test)
- self.failedCount += (test.result.code == lit.Test.FAIL)
- if self.failedCount == self.maxFailures:
- provider.cancel()
- consumer.display = _Display(consumer.display)
+ consumer.display = _Display(consumer.display, provider, maxFailures)
class Run(object):
"""