From 6a5ec5c046817e8b1b0867b6d1a14f7e19ad2c4a Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 20 Nov 2019 17:59:15 +0100 Subject: [PATCH] tests: skip tests without xmlschema --- testing/test_junitxml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 4c2f22a3d6e..6a307f6f373 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -4,7 +4,6 @@ from xml.dom import minidom import py -import xmlschema import pytest from _pytest.junitxml import LogXML @@ -15,6 +14,7 @@ @pytest.fixture(scope="session") def schema(): """Returns a xmlschema.XMLSchema object for the junit-10.xsd file""" + xmlschema = pytest.importorskip("xmlschema") fn = Path(__file__).parent / "example_scripts/junit-10.xsd" with fn.open() as f: return xmlschema.XMLSchema(f)