8000 Get warnings properly paid attention to in the tests. · awesome-python/html5lib-python@af32645 · GitHub
[go: up one dir, main page]

Skip to content

Commit af32645

Browse files
committed
Get warnings properly paid attention to in the tests.
1 parent 7092294 commit af32645

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

html5lib/tests/test_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def convertTreeDump(data):
2525

2626
def runParserTest(innerHTML, input, expected, errors, treeClass,
2727
namespaceHTMLElements):
28+
warnings.resetwarnings()
29+
warnings.simplefilter("error")
2830
#XXX - move this out into the setup function
2931
#concatenate all consecutive character tokens into a single token
3032
try:

html5lib/tests/test_tokenizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def decode(inp):
140140
return test
141141

142142
def runTokenizerTest(test):
143+
warnings.resetwarnings()
144+
warnings.simplefilter("error")
143145
#XXX - move this out into the setup function
144146
#concatenate all consecutive character tokens into a single token
145147
if 'doubleEscaped' in test:

html5lib/tests/test_treewalkers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
except AttributeError:
99
unittest.TestCase.assertEqual = unittest.TestCase.assertEquals
1010

11-
warnings.simplefilter("error")
12-
1311
from .support import get_data_files, TestData, convertExpected
1412

1513
from html5lib import html5parser, treewalkers, treebuilders, constants
@@ -271,6 +269,8 @@ def test_all_tokens(self):
271269
self.assertEqual(expectedToken, outputToken)
272270

273271
def runTreewalkerTest(innerHTML, input, expected, errors, treeClass):
272+
warnings.resetwarnings()
273+
warnings.simplefilter("error")
274274
try:
275275
p = html5parser.HTMLParser(tree = treeClass["builder"])
276276
if innerHTML:

0 commit comments

Comments
 (0)
0