@pytest.fixture()
def schema_match(manager):
 def match(schema, response):
  validator = jsonschema.Draft4Validator(schema)
  errors = list(validator.iter_errors(response))
  return [dict(value=list(e.path), message=e.message) for e in errors]
 return match

@ pytest . fixture ( ) def schema_match ( manager ) : def match ( schema , response ) : validator = jsonschema . Draft4Validator ( schema ) errors = list ( validator . iter_errors ( response ) ) return [ dict ( value = list ( e . path ) , message = e . message ) for e in errors ] return match
this fixture enables verifying json schema .