Skip to content

Commit 47da8d2

Browse files
authored
TestKit backend: fix attempt to close ManagedTransaction (#797)
1 parent c468106 commit 47da8d2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

testkitbackend/_async/backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ async def close(self):
7575
self.drivers,
7676
):
7777
for key, closable in dict_of_closables.items():
78+
if not hasattr(closable, "close"): # e.g., ManagedTransaction
79+
continue
7880
try:
7981
await closable.close()
8082
except (Neo4jError, DriverError, OSError):

testkitbackend/_sync/backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def close(self):
7575
self.drivers,
7676
):
7777
for key, closable in dict_of_closables.items():
78+
if not hasattr(closable, "close"): # e.g., ManagedTransaction
79+
continue
7880
try:
7981
closable.close()
8082
except (Neo4jError, DriverError, OSError):

0 commit comments

Comments
 (0)