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

Method test_extend_mutable_list

Lib/test/test_xml_etree.py:2809–2826  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2807class BadElementTest(ElementTestCase, unittest.TestCase):
2808
2809 def test_extend_mutable_list(self):
2810 class X:
2811 @property
2812 def __class__(self):
2813 L[:] = [ET.Element('baz')]
2814 return ET.Element
2815 L = [X()]
2816 e = ET.Element('foo')
2817 try:
2818 e.extend(L)
2819 except TypeError:
2820 pass
2821
2822 class Y(X, ET.Element):
2823 pass
2824 L = [Y('x')]
2825 e = ET.Element('foo')
2826 e.extend(L)
2827
2828 def test_extend_mutable_list2(self):
2829 class X:

Callers

nothing calls this directly

Calls 3

extendMethod · 0.95
XClass · 0.70
YClass · 0.70

Tested by

no test coverage detected