test: address Adrian+syncrain PR feedback

- remove first docstring line (Adrian: unnecessary)
- replace weak isinstance assert with no-op call
- keep Cython function mention (Adrian: wording is great)
This commit is contained in:
MeGaurav4 2026-06-29 19:31:12 +05:30
parent 099b6e47e0
commit e787fbb139
1 changed files with 3 additions and 6 deletions

View File

@ -314,13 +314,10 @@ def test_xml_entity_expansion():
def test_sitemap_non_string_tag():
"""Regression test for non-string elem.tag crashing _get_tag_name.
With recover=True and resolve_entities=False, libxml2 >= 2.14.6 (used
"""With recover=True and resolve_entities=False, libxml2 >= 2.14.6 (used
by lxml >= 6.1.1) preserves undeclared entity reference nodes whose
.tag is a non-string `Cython function` object instead of a str.
.tag is a non-string ``Cython function`` object instead of a ``str``.
_get_tag_name must handle this gracefully instead of raising
AttributeError.
"""
results = list(Sitemap(b"<url>&k;"))
assert isinstance(results, list)
list(Sitemap(b"<url>&k;"))