Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions neo4j/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ def _disconnect(self, sync):
if self._connection:
if sync:
self._connection.sync()
self._connection.in_use = False
self._connection = None
if self._connection:
self._connection.in_use = False
self._connection = None
self._connection_access_mode = None

def close(self):
Expand Down
5 changes: 5 additions & 0 deletions test/integration/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,11 @@ def test_peek_at_different_stages(self):
upcoming = result.peek()
assert upcoming is None

def test_can_safely_exit_session_without_consuming_result(self):
with self.driver.session() as session:
session.run("RETURN 1")
assert True


class SessionCompletionTestCase(DirectIntegrationTestCase):

Expand Down