summaryrefslogtreecommitdiff
path: root/tests/util.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-12-15 13:12:13 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-12-15 17:15:49 +0900
commit9fc53cecf74fae33ac8509d34eea334ad4193d2b (patch)
tree330d9f4269b752216684512d90cf99ffae7f2d0f /tests/util.py
parent108491d49ea37f8e42ad32242167bc8a00f89cd8 (diff)
downloadsphinx-git-9fc53cecf74fae33ac8509d34eea334ad4193d2b.tar.gz
Reduce deprecation warnings (refs: #3192)
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py8
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)