Skip to content

Commit 5bd3413

Browse files
committed
Use lint filter to ensure validity of treewalkers
1 parent 66ef026 commit 5bd3413

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

html5lib/tests/test_treewalkers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .support import get_data_files, TestData, convertExpected
1515

1616
from html5lib import html5parser, treewalkers, treebuilders, treeadapters, constants
17+
from html5lib.filters.lint import Filter as Lint
1718

1819

1920
treeTypes = {
@@ -91,7 +92,7 @@ def test_all_tokens(self):
9192
p = html5parser.HTMLParser(tree=treeCls["builder"])
9293
document = p.parse("<html><head></head><body>a<div>b</div>c</body></html>")
9394
document = treeCls.get("adapter", lambda x: x)(document)
94-
output = treeCls["walker"](document)
95+
output = Lint(treeCls["walker"](document))
9596
for expectedToken, outputToken in zip(expected, output):
9697
self.assertEqual(expectedToken, outputToken)
9798

@@ -111,7 +112,7 @@ def runTreewalkerTest(innerHTML, input, expected, errors, treeClass):
111112

112113
document = treeClass.get("adapter", lambda x: x)(document)
113114
try:
114-
output = treewalkers.pprint(treeClass["walker"](document))
115+
output = treewalkers.pprint(Lint(treeClass["walker"](document)))
115116
output = attrlist.sub(sortattrs, output)
116117
expected = attrlist.sub(sortattrs, convertExpected(expected))
117118
diff = "".join(unified_diff([line + "\n" for line in expected.splitlines()],

0 commit comments

Comments
 (0)