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

Method test_element_get_tail

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

Source from the content-addressed store, hash-verified

3035 self.assertEqual(elem.text, 'ABCDEFGHIJKL')
3036
3037 def test_element_get_tail(self):
3038 # Issue #27863
3039 class X(str):
3040 def __del__(self):
3041 try:
3042 elem[0].tail
3043 except NameError:
3044 pass
3045
3046 b = ET.TreeBuilder()
3047 b.start('root', {})
3048 b.start('tag', {})
3049 b.end('tag')
3050 b.data('ABCD')
3051 b.data(X('EFGH'))
3052 b.data('IJKL')
3053 b.end('root')
3054
3055 elem = b.close()
3056 self.assertEqual(elem[0].tail, 'ABCDEFGHIJKL')
3057
3058 def test_subscr_with_clear(self):
3059 # See https://github.com/python/cpython/issues/143200.

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected