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

Method test_element_get_text

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

Source from the content-addressed store, hash-verified

3016 repr(e) # Should not crash
3017
3018 def test_element_get_text(self):
3019 # Issue #27863
3020 class X(str):
3021 def __del__(self):
3022 try:
3023 elem.text
3024 except NameError:
3025 pass
3026
3027 b = ET.TreeBuilder()
3028 b.start('tag', {})
3029 b.data('ABCD')
3030 b.data(X('EFGH'))
3031 b.data('IJKL')
3032 b.end('tag')
3033
3034 elem = b.close()
3035 self.assertEqual(elem.text, 'ABCDEFGHIJKL')
3036
3037 def test_element_get_tail(self):
3038 # Issue #27863

Callers

nothing calls this directly

Calls 6

startMethod · 0.95
dataMethod · 0.95
endMethod · 0.95
closeMethod · 0.95
XClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected