Skip to content

Commit e17a925

Browse files
committed
Fix warning about write-ops against read-only db
Cleanup on GDS db only if data exists. Avoid cleanups for empty dbs (such as in session setup).
1 parent 27fe457 commit e17a925

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graphdatascience/tests/integration/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ def clean_up(gds: GraphDataScience) -> Generator[None, None, None]:
159159
model.drop(failIfMissing=True)
160160

161161
try:
162-
gds.run_cypher("MATCH (n) DETACH DELETE (n)")
162+
# for the session setup there should be no data
163+
if gds.run_cypher("MATCH (n) RETURN count(n)").squeeze() > 0:
164+
gds.run_cypher("MATCH (n) DETACH DELETE (n)")
163165
except neo4j.exceptions.ClientError as e:
164166
print(e)
165167

0 commit comments

Comments
 (0)