(self)
| 2522 | self.assertEqual(e[0].tail, 'changed') |
| 2523 | |
| 2524 | def test_lost_elem(self): |
| 2525 | # Issue #25902: Borrowed element can disappear |
| 2526 | class Tag: |
| 2527 | def __eq__(self, other): |
| 2528 | e[0] = ET.Element('changed') |
| 2529 | next(i) |
| 2530 | return True |
| 2531 | |
| 2532 | e = ET.Element('root') |
| 2533 | e.append(ET.Element(Tag())) |
| 2534 | e.append(ET.Element('tag')) |
| 2535 | i = e.iter('tag') |
| 2536 | try: |
| 2537 | t = next(i) |
| 2538 | except ValueError: |
| 2539 | self.skipTest('generators are not reentrant') |
| 2540 | self.assertIsInstance(t.tag, Tag) |
| 2541 | self.assertIsInstance(e[0].tag, str) |
| 2542 | self.assertEqual(e[0].tag, 'changed') |
| 2543 | |
| 2544 | def check_expat224_utf8_bug(self, text): |
| 2545 | xml = b'<a b="%s"/>' % text |
nothing calls this directly
no test coverage detected