Skip to content
Snippets Groups Projects
Commit abca45785d80 authored by Charlie Clark's avatar Charlie Clark
Browse files

Make tests package

parent 338199af62e0
Branches
No related tags found
No related merge requests found
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
# Python stdlib imports
from lxml.doctestcompare import LXMLOutputChecker, PARSE_XML
def compare_xml(generated, expected):
"""Use doctest checking from lxml for comparing XML trees. Returns diff if the two are not the same"""
checker = LXMLOutputChecker()
class DummyDocTest():
pass
ob = DummyDocTest()
ob.want = expected
check = checker.check_output(expected, generated, PARSE_XML)
if check is False:
diff = checker.output_difference(ob, generated, PARSE_XML)
return diff
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment