(self)
| 3587 | e.findall('/tag') |
| 3588 | |
| 3589 | def test_find_through_ElementTree(self): |
| 3590 | e = ET.XML(SAMPLE_XML) |
| 3591 | self.assertEqual(ET.ElementTree(e).find('tag').tag, 'tag') |
| 3592 | self.assertEqual(ET.ElementTree(e).findtext('tag'), 'text') |
| 3593 | self.assertEqual(summarize_list(ET.ElementTree(e).findall('tag')), |
| 3594 | ['tag'] * 2) |
| 3595 | # this produces a warning |
| 3596 | msg = ("This search is broken in 1.3 and earlier, and will be fixed " |
| 3597 | "in a future version. If you rely on the current behaviour, " |
| 3598 | "change it to '.+'") |
| 3599 | with self.assertWarnsRegex(FutureWarning, msg): |
| 3600 | it = ET.ElementTree(e).findall('//tag') |
| 3601 | self.assertEqual(summarize_list(it), ['tag'] * 3) |
| 3602 | |
| 3603 | |
| 3604 | class ElementIterTest(unittest.TestCase): |
nothing calls this directly
no test coverage detected