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

Method assertIsNot

Lib/unittest/case.py:1208–1212  ·  view source on GitHub ↗

Just like self.assertTrue(a is not b), but with a nicer default message.

(self, expr1, expr2, msg=None)

Source from the content-addressed store, hash-verified

1206 self.fail(self._formatMessage(msg, standardMsg))
1207
1208 def assertIsNot(self, expr1, expr2, msg=None):
1209 """Just like self.assertTrue(a is not b), but with a nicer default message."""
1210 if expr1 is expr2:
1211 standardMsg = 'unexpectedly identical: %s' % (safe_repr(expr1),)
1212 self.fail(self._formatMessage(msg, standardMsg))
1213
1214 def assertDictEqual(self, d1, d2, msg=None):
1215 self.assertIsInstance(d1, dict, 'First argument is not a dictionary')

Calls 3

failMethod · 0.95
_formatMessageMethod · 0.95
safe_reprFunction · 0.85