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

Method assertIsNot

Lib/unittest/case.py:1213–1217  ·  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

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

Calls 3

failMethod · 0.95
_formatMessageMethod · 0.95
safe_reprFunction · 0.85