diff options
Diffstat (limited to 'tests/util.py')
-rw-r--r-- | tests/util.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/util.py b/tests/util.py index 120492d47..13366a1da 100644 --- a/tests/util.py +++ b/tests/util.py @@ -11,7 +11,9 @@ import os import re import sys import tempfile +import warnings from functools import wraps +from xml.etree import ElementTree from six import StringIO, string_types @@ -155,6 +157,12 @@ def skip_unless_importable(module, msg=None): return skip_if(False, msg) +def etree_parse(path): + with warnings.catch_warnings(record=False): + warnings.filterwarnings("ignore", category=DeprecationWarning) + return ElementTree.parse(path) + + class Struct(object): def __init__(self, **kwds): self.__dict__.update(kwds) |