8000 Fix treewalker tests (doctype with no name is not an error) · awesome-python/html5lib-python@444e5b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 444e5b3

Browse files
committed
Fix treewalker tests (doctype with no name is not an error)
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40877
1 parent 9581b91 commit 444e5b3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/html5lib/filters/lint.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def __iter__(self):
7777
raise LintError(_("Doctype not in PCDATA content model flag: %s") % name)
7878
if not isinstance(name, unicode):
7979
raise LintError(_(u"Tag name is not a string: %r") % name)
80-
if not name:
81-
raise LintError(_(u"Empty tag name"))
8280
# XXX: what to do with token["data"] ?
8381

8482
elif type in ("ParseError", "SerializeError"):

tests/test_treewalkers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def convertTokens(tokens):
184184
if token["name"]:
185185
output.append("%s<!DOCTYPE %s>" % (" "*indent, token["name"]))
186186
else:
187-
output.append("%s<!DOCTYPE>" % " "*indent)
187+
output.append("%s<!DOCTYPE>" % (" "*indent,))
188188
elif type in ("Characters", "SpaceCharacters"):
189189
output.append("%s\"%s\"" % (" "*indent< 7337 /span>, token["data"]))
190190
else:
@@ -217,7 +217,7 @@ def runTest(self, innerHTML, input, expected, errors, treeClass):
217217
"", "Recieved:", output
218218
]))
219219
except LintError, le:
220-
self.fail(le.message)
220+
self.fail(input + "\n" + le.message)
221221
except NotImplementedError:
222222
pass # Amnesty for those that confess...
223223

0 commit comments

Comments
 (0)
0