(self)
| 2506 | self.assertEqual(e.text, 'changed') |
| 2507 | |
| 2508 | def test_lost_tail(self): |
| 2509 | # Issue #25902: Borrowed tail can disappear |
| 2510 | class Text: |
| 2511 | def __bool__(self): |
| 2512 | e[0].tail = 'changed' |
| 2513 | return True |
| 2514 | |
| 2515 | e = ET.Element('root') |
| 2516 | e.append(ET.Element('tag')) |
| 2517 | e[0].tail = Text() |
| 2518 | i = e.itertext() |
| 2519 | t = next(i) |
| 2520 | self.assertIsInstance(t, Text) |
| 2521 | self.assertIsInstance(e[0].tail, str) |
| 2522 | self.assertEqual(e[0].tail, 'changed') |
| 2523 | |
| 2524 | def test_lost_elem(self): |
| 2525 | # Issue #25902: Borrowed element can disappear |
nothing calls this directly
no test coverage detected