From 7b9f40eb1ce79a4898a1f1a20434d7fa7766c47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9n=C3=A9dikt?= <10796600+picnixz@users.noreply.github.com> Date: Sun, 24 Mar 2024 10:04:24 +0100 Subject: [PATCH] remove ``html5lib`` --- pyproject.toml | 1 - tests/test_htmlhelp.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fb933af..60e55cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,6 @@ dynamic = ["version"] [project.optional-dependencies] test = [ "pytest", - "html5lib", ] lint = [ "flake8", diff --git a/tests/test_htmlhelp.py b/tests/test_htmlhelp.py index f0d74b6..c67bf0a 100644 --- a/tests/test_htmlhelp.py +++ b/tests/test_htmlhelp.py @@ -4,7 +4,7 @@ from pathlib import Path import pytest -from html5lib import HTMLParser +from xml.etree.ElementTree import parse as xml_parse from sphinxcontrib.htmlhelp import chm_htmlescape, default_htmlhelp_basename from sphinx.config import Config @@ -76,8 +76,8 @@ def assert_sitemap(node, name, filename): # .hhc file hhc = (app.outdir / 'pythondoc.hhc').read_text() - tree = HTMLParser(namespaceHTMLElements=False).parse(hhc) - items = tree.find('.//body/ul') + etree = xml_parse(app.outdir / 'pythondoc.hhc') + items = etree.find('.//body/ul') assert len(items) == 4 # index