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

Method testClassCallRecursionLimit

Lib/test/test_class.py:814–827  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

812 self.assertEqual(A, (tuple(range(8)), {'foo': 'bar'}))
813
814 def testClassCallRecursionLimit(self):
815 class C:
816 def __init__(self):
817 self.c = C()
818
819 with self.assertRaises(RecursionError):
820 C()
821
822 def add_one_level():
823 #Each call to C() consumes 2 levels, so offset by 1.
824 C()
825
826 with self.assertRaises(RecursionError):
827 add_one_level()
828
829 def testMetaclassCallOptimization(self):
830 calls = 0

Callers

nothing calls this directly

Calls 2

CClass · 0.70
assertRaisesMethod · 0.45

Tested by

no test coverage detected