From f2105273fba180f5a4c8a1d7a520994583c575f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 19 Oct 2024 19:03:44 +0200 Subject: [PATCH] Silence xpath warning in tests --- py3o/template/tests/test_templates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py3o/template/tests/test_templates.py b/py3o/template/tests/test_templates.py index 91dbb7b..91e70e6 100644 --- a/py3o/template/tests/test_templates.py +++ b/py3o/template/tests/test_templates.py @@ -684,7 +684,7 @@ def test_image_injection(self): i = 0 nmspc = template.namespaces - table = content_list.find("//table:table", nmspc) + table = content_list.find(".//table:table", nmspc) frame_path = "table:table-cell/text:p/draw:frame" images_hrefs = set() for row in table.findall("table:table-row", nmspc): @@ -707,7 +707,7 @@ def test_image_injection(self): # check if images are into the manifest manifest_el = lxml.etree.parse(BytesIO(outodt.read(MANIFEST))) - file_entries = manifest_el.findall("//manifest:file-entry", nmspc) + file_entries = manifest_el.findall(".//manifest:file-entry", nmspc) for entry in file_entries: path = entry.get("{{{}}}full-path".format(nmspc["manifest"])) if path in images_hrefs: @@ -971,7 +971,7 @@ def test_remove_soft_page_breaks(self): ) nmspc = template.namespaces - paragraphs = content_list.findall("//text:p", nmspc) + paragraphs = content_list.findall(".//text:p", nmspc) bottom_break_paragraphs, middle_break_paragraphs = 0, 0 for p in paragraphs: if not p.text: