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

Method assertIsNone

Lib/unittest/case.py:1317–1321  ·  view source on GitHub ↗

Same as self.assertTrue(obj is None), with a nicer default message.

(self, obj, msg=None)

Source from the content-addressed store, hash-verified

1315 self.fail(self._formatMessage(msg, standardMsg))
1316
1317 def assertIsNone(self, obj, msg=None):
1318 """Same as self.assertTrue(obj is None), with a nicer default message."""
1319 if obj is not None:
1320 standardMsg = '%s is not None' % (safe_repr(obj),)
1321 self.fail(self._formatMessage(msg, standardMsg))
1322
1323 def assertIsNotNone(self, obj, msg=None):
1324 """Included for symmetry with assertIsNone."""

Calls 3

failMethod · 0.95
_formatMessageMethod · 0.95
safe_reprFunction · 0.85