Skip to content

Commit 6ffd5f6

Browse files
author
matmoncon
committed
test: fix test which closed client prematurely
1 parent 1a27569 commit 6ffd5f6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/integration/test_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ async def test_ensure_connection(client: Pyneo4jClient):
7474
client = Pyneo4jClient()
7575
await client.cypher("MATCH (n) RETURN n")
7676

77-
with pytest.raises(NotConnectedToDatabase):
78-
await client.close()
79-
await client.cypher("MATCH (n) RETURN n")
80-
8177
await client.connect("bolt://localhost:7687", auth=("neo4j", "password"))
8278
results, _ = await client.cypher("MATCH (n) RETURN n")
8379
assert results == []
8480

81+
with pytest.raises(NotConnectedToDatabase):
82+
await client.close()
83+
await client.cypher("MATCH (n) RETURN n")
84+
8585

8686
async def test_register_models(client: Pyneo4jClient, session: AsyncSession):
8787
class ClientNodeModel(NodeModel):
@@ -109,11 +109,13 @@ class Settings:
109109

110110
query_results = await session.run("SHOW CONSTRAINTS")
111111
constraint_results = [result.values() async for result in query_results]
112+
await query_results.consume()
112113

113114
assert len(constraint_results) == 3
114115

115116
query_results = await session.run("SHOW INDEXES")
116117
index_results = [result.values() async for result in query_results]
118+
await query_results.consume()
117119

118120
assert len(index_results) == 12
119121

0 commit comments

Comments
 (0)