MCPcopy Index your code
hub / github.com/RustPython/RustPython / _addUnexpectedSuccess

Method _addUnexpectedSuccess

Lib/unittest/case.py:592–605  ·  view source on GitHub ↗
(self, result)

Source from the content-addressed store, hash-verified

590 addExpectedFailure(self, exc_info)
591
592 def _addUnexpectedSuccess(self, result):
593 try:
594 addUnexpectedSuccess = result.addUnexpectedSuccess
595 except AttributeError:
596 warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failure",
597 RuntimeWarning)
598 # We need to pass an actual exception and traceback to addFailure,
599 # otherwise the legacy result can choke.
600 try:
601 raise _UnexpectedSuccess from None
602 except _UnexpectedSuccess:
603 result.addFailure(self, sys.exc_info())
604 else:
605 addUnexpectedSuccess(self)
606
607 def _addDuration(self, result, elapsed):
608 try:

Callers 1

runMethod · 0.95

Calls 2

warnMethod · 0.45
addFailureMethod · 0.45

Tested by

no test coverage detected