Don't fail tests when xmlschema is missing
authorJannis Harder <me@jix.one>
Fri, 3 Jun 2022 15:16:01 +0000 (17:16 +0200)
committerJannis Harder <me@jix.one>
Fri, 3 Jun 2022 15:22:45 +0000 (17:22 +0200)
tests/junit/validate_junit.py

index c1c0573f4b6819f0a3092c4953040d9427ede36c..1999551c6c974fb2bfcf3503278c675263e5616d 100644 (file)
@@ -1,4 +1,13 @@
-from xmlschema import XMLSchema, XMLSchemaValidationError
+try:
+    from xmlschema import XMLSchema, XMLSchemaValidationError
+except ImportError:
+    import os
+    if "NOSKIP" not in os.environ.get("MAKEFLAGS", ""):
+        print()
+        print("SKIPPING python library xmlschema not found, skipping JUnit output validation")
+        print()
+        exit(0)
+
 import argparse
 
 def main():