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

Method assert_functions_equal

Lib/test/test_crossinterp.py:383–390  ·  view source on GitHub ↗
(self, func1, func2)

Source from the content-addressed store, hash-verified

381 MODE = None
382
383 def assert_functions_equal(self, func1, func2):
384 assert type(func1) is types.FunctionType, repr(func1)
385 assert type(func2) is types.FunctionType, repr(func2)
386 self.assertEqual(func1.__name__, func2.__name__)
387 self.assertEqual(func1.__code__, func2.__code__)
388 self.assertEqual(func1.__defaults__, func2.__defaults__)
389 self.assertEqual(func1.__kwdefaults__, func2.__kwdefaults__)
390 # We don't worry about __globals__ for now.
391
392 def assert_exc_args_equal(self, exc1, exc2):
393 args1 = exc1.args

Callers 1

Calls 1

assertEqualMethod · 0.45

Tested by

no test coverage detected