(self)
| 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. |