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

Method assertIs

Lib/unittest/case.py:1206–1211  ·  view source on GitHub ↗

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

(self, expr1, expr2, msg=None)

Source from the content-addressed store, hash-verified

1204 self.fail(self._formatMessage(msg, standardMsg))
1205
1206 def assertIs(self, expr1, expr2, msg=None):
1207 """Just like self.assertTrue(a is b), but with a nicer default message."""
1208 if expr1 is not expr2:
1209 standardMsg = '%s is not %s' % (safe_repr(expr1),
1210 safe_repr(expr2))
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."""

Calls 3

failMethod · 0.95
_formatMessageMethod · 0.95
safe_reprFunction · 0.85