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

Method assertTrue

Lib/unittest/case.py:756–760  ·  view source on GitHub ↗

Check that the expression is true.

(self, expr, msg=None)

Source from the content-addressed store, hash-verified

754 raise self.failureException(msg)
755
756 def assertTrue(self, expr, msg=None):
757 """Check that the expression is true."""
758 if not expr:
759 msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
760 raise self.failureException(msg)
761
762 def _formatMessage(self, msg, standardMsg):
763 """Honour the longMessage attribute when generating failure messages.

Callers 15

test_astMethod · 0.95
test_enter_concurrentMethod · 0.95
test_priorityMethod · 0.95
test_emptyMethod · 0.95
check_pickleMethod · 0.95
test_iter_idempotencyMethod · 0.95
_test_set_comparisonsMethod · 0.95
test_simple_compareMethod · 0.95
test_class_markerMethod · 0.95

Calls 2

_formatMessageMethod · 0.95
safe_reprFunction · 0.85

Tested by 15

test_astMethod · 0.76
test_enter_concurrentMethod · 0.76
test_priorityMethod · 0.76
test_emptyMethod · 0.76
check_pickleMethod · 0.76
test_iter_idempotencyMethod · 0.76
_test_set_comparisonsMethod · 0.76
test_simple_compareMethod · 0.76
test_class_markerMethod · 0.76