Skip to content

Commit 309826f

Browse files
committed
Test sessions expiring in the pool
1 parent e28cd52 commit 309826f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_session.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ def session_pool_cannot_exceed_max_size(self):
5050
driver.session().close()
5151
assert len(driver.session_pool) == 1
5252

53+
def test_session_that_dies_in_the_pool_will_not_be_given_out(self):
54+
driver = GraphDatabase.driver("bolt://localhost")
55+
session_1 = driver.session()
56+
session_1.close()
57+
assert len(driver.session_pool) == 1
58+
session_1.connection.close()
59+
session_2 = driver.session()
60+
assert session_2 is not session_1
61+
5362

5463
class RunTestCase(TestCase):
5564

0 commit comments

Comments
 (0)