diff options
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,8 +1,10 @@ from __future__ import print_function + +import io import os import sys import unittest -import io +import warnings from xml.sax.saxutils import XMLGenerator from xml.sax import SAXParseException @@ -30,6 +32,12 @@ except ImportError: LXML3 = False +warnings.filterwarnings( + 'error', + category=DeprecationWarning, + module=r"defusedxml\..*" +) + HERE = os.path.dirname(os.path.abspath(__file__)) # prevent web access @@ -186,6 +194,12 @@ class TestDefusedElementTree(BaseTests): def iterparse(self, source, **kwargs): return list(self.module.iterparse(source, **kwargs)) + def test_html_arg(self): + with self.assertRaises(DeprecationWarning): + ElementTree.XMLParse(html=0) + with self.assertRaises(TypeError): + ElementTree.XMLParse(html=1) + class TestDefusedcElementTree(TestDefusedElementTree): module = cElementTree |