import json path = "fixtures/database.json" with open(path, "r") as f: data = json.load(f) test_case = data[-1] test_case["tests"][0]["expect"]["schemas"] = [ "full.contact", "full.person", "full.person/ad_hoc_bubble", "full.person/extended_relations", "full.person/extended_relations/items", "light.email_address", "some_bubble", "student.person" ] with open(path, "w") as f: json.dump(data, f, indent=2)