(self)
| 2990 | self.assertEqual(elem.text, 'ABCDEFGHIJKL') |
| 2991 | |
| 2992 | def test_element_get_tail(self): |
| 2993 | # Issue #27863 |
| 2994 | class X(str): |
| 2995 | def __del__(self): |
| 2996 | try: |
| 2997 | elem[0].tail |
| 2998 | except NameError: |
| 2999 | pass |
| 3000 | |
| 3001 | b = ET.TreeBuilder() |
| 3002 | b.start('root', {}) |
| 3003 | b.start('tag', {}) |
| 3004 | b.end('tag') |
| 3005 | b.data('ABCD') |
| 3006 | b.data(X('EFGH')) |
| 3007 | b.data('IJKL') |
| 3008 | b.end('root') |
| 3009 | |
| 3010 | elem = b.close() |
| 3011 | self.assertEqual(elem[0].tail, 'ABCDEFGHIJKL') |
| 3012 | |
| 3013 | def test_subscr_with_clear(self): |
| 3014 | # See https://github.com/python/cpython/issues/143200. |