summaryrefslogtreecommitdiff
path: root/tests/util.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-12-17 15:59:13 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-12-17 15:59:13 +0900
commitab00f5fe49f57d4ee8bc25127db9b12fbed4f54f (patch)
treeedb2d68140b3e920cfff7fe663019612ab47a1c7 /tests/util.py
parentb1e4036640b5d2290674e1a04f957f015d89f62d (diff)
parent7b3327234dc1f4385c175d29c68be430bba4c8f5 (diff)
downloadsphinx-git-ab00f5fe49f57d4ee8bc25127db9b12fbed4f54f.tar.gz
Merge branch 'stable'
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)