Skip to content

Commit

Permalink
Debugging test: check out result
Browse files Browse the repository at this point in the history
  • Loading branch information
borzunov committed Aug 16, 2022
1 parent e0885c5 commit 8e8b85c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_p2p_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ async def test_removing_stream_handlers(server_client):
servicer = UnaryStreamServicer()
stub = UnaryStreamServicer.get_stub(client, server1.peer_id)

for server in [server1, server2, server1]:
for i, server in enumerate([server1, server2, server1]):
print(f'debug: i = {i}')

await servicer.add_p2p_handlers(server)
stream = await stub.rpc_count(test_pb2.TestRequest(number=10))
assert [item.number async for item in stream] == list(range(10))

await servicer.remove_p2p_handlers(server)
with pytest.raises(P2PDaemonError):
stream = await stub.rpc_count(test_pb2.TestRequest(number=10))
async for _ in stream:
pass
assert [item.number async for item in stream] == list(range(10))

await asyncio.gather(server2.shutdown())

0 comments on commit 8e8b85c

Please sign in to comment.