@@ -78,23 +78,26 @@ def pytest_generate_tests(metafunc):
7878 suites .append (Suite (schema , test ["data" ], test ["valid" ]))
7979
8080 # Examples
81- for config_filename in glob .glob ("examples/*/.config.json" ):
82- with open (config_filename ) as o :
83- data = json .load (o )
84- schema = data ["schema" ]
85- with open (schema ) as f :
86- schema = json .load (f )
87- example_folder = os .path .dirname (config_filename )
88- for filename in glob .glob (f"{ example_folder } /*.json" ):
89- with open (filename ) as f :
90- # Strip comments
91- data = "" .join (
92- line for line in f if not line .lstrip ().startswith ("//" )
93- )
94- data = json .loads (data )
95- data = data ["attributes" ] # Only validate the attributes object
96- ids .append ("example_" + str (filename ).split ("/" )[- 1 ][0 :- 5 ])
97- suites .append (Suite (schema , data , True )) # Assume true
81+ # TODO: Split examples into snippets (used for reference in spec) and
82+ # complete examples (to be validated here)
83+ # for config_filename in glob.glob("ngff_spec/examples/*/.config.json"):
84+ # with open(config_filename) as o:
85+ # data = json.load(o)
86+ # schema = data["schema"]
87+ # with open(schema) as f:
88+ # schema = json.load(f)
89+ # example_folder = os.path.dirname(config_filename)
90+ # for filename in glob.glob(f"{example_folder}/*.json"):
91+ # print(filename)
92+ # with open(filename) as f:
93+ # # Strip comments
94+ # data = "".join(
95+ # line for line in f if not line.lstrip().startswith("//")
96+ # )
97+ # data = json.loads(data)
98+ # data = data["attributes"] # Only validate the attributes object
99+ # ids.append("example_" + str(filename).split("/")[-1][0:-5])
100+ # suites.append(Suite(schema, data, True)) # Assume true
98101
99102 metafunc .parametrize ("suite" , suites , ids = ids , indirect = True )
100103
0 commit comments