validate(yaml.load(good_instance), yaml.load(schema))
bad_instance = """
testing: ['this', 'is', 'a', 'bad', 'test']
"""
validate(yaml.load(bad_instance), yaml.load(schema))
Проверка документа yaml в python