@@ -99,7 +99,10 @@ class SanityTests(unittest.TestCase):
99
99
assert cls .test_files , "Didn't find the test files!"
100
100
print (f"Found { len (cls .test_files )} test files" )
101
101
102
- cls .output_test_files = list (collect (OUTPUT_ROOT_DIR ))
102
+ cls .output_test_files = [
103
+ each for each in collect (OUTPUT_ROOT_DIR )
104
+ if each .name != "output-schema.json"
105
+ ]
103
106
assert cls .output_test_files , "Didn't find the output test files!"
104
107
print (f"Found { len (cls .output_test_files )} output test files" )
105
108
@@ -234,19 +237,22 @@ class SanityTests(unittest.TestCase):
234
237
"""
235
238
All test files are valid under test-schema.json.
236
239
"""
237
- Validator = jsonschema .validators .validator_for (TESTSUITE_SCHEMA )
238
- validator = Validator (TESTSUITE_SCHEMA )
240
+ Validator = jsonschema .validators .validator_for (TEST_SCHEMA )
241
+ validator = Validator (TEST_SCHEMA )
239
242
for path , cases in files (self .test_files ):
240
243
with self .subTest (path = path ):
241
244
try :
242
245
validator .validate (cases )
243
246
except jsonschema .ValidationError as error :
244
247
self .fail (str (error ))
248
+
249
+ @unittest .skipIf (jsonschema is None , "Validation library not present!" )
250
+ def test_output_suites_are_valid (self ):
245
251
"""
246
252
All output test files are valid under output-test-schema.json.
247
253
"""
248
- Validator = jsonschema .validators .validator_for (OUTPUTTESTSUITE_SCHEMA )
249
- validator = Validator (OUTPUTTESTSUITE_SCHEMA )
254
+ Validator = jsonschema .validators .validator_for (OUTPUT_TEST_SCHEMA )
255
+ validator = Validator (OUTPUT_TEST_SCHEMA )
250
256
for path , cases in files (self .output_test_files ):
251
257
with self .subTest (path = path ):
252
258
try :
0 commit comments