MCPcopy Index your code
hub / github.com/python/cpython / wasSuccessful

Method wasSuccessful

Lib/unittest/result.py:172–179  ·  view source on GitHub ↗

Tells whether or not this result was a success.

(self)

Source from the content-addressed store, hash-verified

170 self.collectedDurations.append((str(test), elapsed))
171
172 def wasSuccessful(self):
173 """Tells whether or not this result was a success."""
174 # The hasattr check is for test_result's OldResult test. That
175 # way this method works on objects that lack the attribute.
176 # (where would such result instances come from? old stored pickles?)
177 return ((len(self.failures) == len(self.errors) == 0) and
178 (not hasattr(self, 'unexpectedSuccesses') or
179 len(self.unexpectedSuccesses) == 0))
180
181 def stop(self):
182 """Indicates that the tests should be aborted."""

Callers 9

test_initMethod · 0.95
test_startTestMethod · 0.95
test_stopTestMethod · 0.95
test_addSuccessMethod · 0.95
test_addFailureMethod · 0.95
test_addErrorMethod · 0.95
test_addSubTestMethod · 0.95
runMethod · 0.45
runTestsMethod · 0.45

Calls

no outgoing calls

Tested by 7

test_initMethod · 0.76
test_startTestMethod · 0.76
test_stopTestMethod · 0.76
test_addSuccessMethod · 0.76
test_addFailureMethod · 0.76
test_addErrorMethod · 0.76
test_addSubTestMethod · 0.76