Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def update_statistics(self):
"""Updates test count and test time."""
tests = errors = failures = skipped = 0
time = 0
for case in self:
tests += 1
if isinstance(case.result, Failure):
failures += 1
elif isinstance(case.result, Error):
errors += 1
elif isinstance(case.result, Skipped):
skipped += 1
if case.time is not None:
time += case.time
self.tests = tests
self.errors = errors
self.failures = failures
self.skipped = skipped
self.time = time
def update_statistics(self):
"""Updates test count and test time."""
tests = errors = failures = skipped = 0
time = 0
for case in self:
tests += 1
if isinstance(case.result, Failure):
failures += 1
elif isinstance(case.result, Error):
errors += 1
elif isinstance(case.result, Skipped):
skipped += 1
if case.time is not None:
time += case.time
self.tests = tests
self.errors = errors
self.failures = failures
self.skipped = skipped
self.time = time
def __eq__(self, other):
return super(Error, self).__eq__(other)
def __eq__(self, other):
return super(Error, self).__eq__(other)