File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import , division , unicode_literals
2
2
3
3
import io
4
+ import warnings
4
5
5
6
from . import support # flake8: noqa
6
7
from html5lib import html5parser
7
- from html5lib .constants import namespaces
8
+ from html5lib .constants import namespaces , DataLossWarning
8
9
from html5lib import treebuilders
9
10
10
11
import unittest
@@ -35,7 +36,13 @@ def test_ihatexml(self):
35
36
if not self .lxml_tree :
36
37
return
37
38
parser = html5parser .HTMLParser (tree = self .lxml_tree )
38
- parser .parse (b'<p xml:lang="pl">Witam wszystkich' )
39
+ with warnings .catch_warnings (record = True ) as w :
40
+ warnings .simplefilter ("always" )
41
+
42
+ parser .parse (b'<p xml:lang="pl">Witam wszystkich' )
43
+
44
+ self .assertEqual (len (w ), 1 )
45
+ self .assertTrue (issubclass (w [- 1 ].category , DataLossWarning ))
39
46
40
47
def test_namespace_html_elements_0_dom (self ):
41
48
parser = html5parser .HTMLParser (tree = self .dom_tree , namespaceHTMLElements = True )
You can’t perform that action at this time.
0 commit comments