From 38d8fd06239fb0563762ba08e90c302b1b501880 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Mon, 30 Apr 2018 10:46:09 -0400 Subject: [PATCH] selftests/unit/test_xunit.py: also output schema validation errors It's useful to show the schema validation errors when invalid output is produced. Signed-off-by: Cleber Rosa --- selftests/unit/test_xunit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selftests/unit/test_xunit.py b/selftests/unit/test_xunit.py index 4267f1c3..69819506 100644 --- a/selftests/unit/test_xunit.py +++ b/selftests/unit/test_xunit.py @@ -91,8 +91,8 @@ class xUnitSucceedTest(unittest.TestCase): xmlschema = etree.XMLSchema(etree.parse(f)) # pylint: disable=I1101 # pylint: disable=I1101 self.assertTrue(xmlschema.validate(etree.parse(BytesIO(xml))), - "Failed to validate against %s, content:\n%s" % - (self.junit, xml)) + "Failed to validate against %s, content:\n%s\nerror log:\n%s" % + (self.junit, xml, xmlschema.error_log)) def test_max_test_log_size(self): log = tempfile.NamedTemporaryFile(dir=self.tmpdir, delete=False) -- GitLab