Skip to content

Commit 60456e8

Browse files
committed
Clarify variable names in test_parser.py.
1 parent 196759a commit 60456e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

html5lib/tests/test_parser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def convertTreeDump(data):
2727

2828
def runParserTest(innerHTML, input, expected, errors, treeClass,
2929
namespaceHTMLElements):
30-
with warnings.catch_warnings(record=True) as w:
30+
with warnings.catch_warnings(record=True) as caughtWarnings:
3131
warnings.simplefilter("always")
3232
p = html5parser.HTMLParser(tree=treeClass,
3333
namespaceHTMLElements=namespaceHTMLElements)
@@ -42,9 +42,10 @@ def runParserTest(innerHTML, input, expected, errors, treeClass,
4242
"\nTraceback:", traceback.format_exc()])
4343
assert False, errorMsg
4444

45-
otherW = [x for x in w if not issubclass(x.category, constants.DataLossWarning)]
46-
assert len(otherW) == 0, [(x.category, x.message) for x in otherW]
47-
if len(w):
45+
otherWarnings = [x for x in caughtWarnings
46+
if not issubclass(x.category, constants.DataLossWarning)]
47+
assert len(otherWarnings) == 0, [(x.category, x.message) for x in otherWarnings]
48+
if len(caughtWarnings):
4849
return
4950

5051
output = convertTreeDump(p.tree.testSerializer(document))

0 commit comments

Comments
 (0)