def populated_memgraph(dataset_file: str) -> Memgraph: memgraph = Memgraph() memgraph.ensure_indexes([]) memgraph.ensure_constraints([]) memgraph.drop_database() with get_data_dir().joinpath(dataset_file).open("r") as dataset: for query in dataset: memgraph.execute(query) yield memgraph memgraph.drop_database()
def memgraph() -> Memgraph: memgraph = Memgraph() memgraph.ensure_indexes([]) memgraph.ensure_constraints([]) memgraph.drop_database() return memgraph