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

Method assert_equal_or_equalish

Lib/test/test_crossinterp.py:435–452  ·  view source on GitHub ↗
(self, obj, expected)

Source from the content-addressed store, hash-verified

433 self.assert_exc_equal(exc1.__context__, exc2.__context__)
434
435 def assert_equal_or_equalish(self, obj, expected):
436 cls = type(expected)
437 if cls.__eq__ is not object.__eq__:
438 self.assertEqual(obj, expected)
439 elif cls is types.FunctionType:
440 self.assert_functions_equal(obj, expected)
441 elif isinstance(expected, BaseException):
442 self.assert_exc_equal(obj, expected)
443 elif cls is types.MethodType:
444 raise NotImplementedError(cls)
445 elif cls is types.BuiltinMethodType:
446 raise NotImplementedError(cls)
447 elif cls is types.MethodWrapperType:
448 raise NotImplementedError(cls)
449 elif cls.__bases__ == (object,):
450 self.assertEqual(obj.__dict__, expected.__dict__)
451 else:
452 raise NotImplementedError(cls)
453
454 def get_xidata(self, obj, *, mode=None):
455 mode = self._resolve_mode(mode)

Calls 3

assert_exc_equalMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected