@pytest.mark.asyncio
async def test_list_realms_async_pager():
client = RealmsServiceAsyncClient(
credentials=ga_credentials.AnonymousCredentials,
)
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
type(client.transport.list_realms), "__call__", new_callable=mock.AsyncMock
) as call:
# Set the response to a series of pages.
call.side_effect = (
realms.ListRealmsResponse(
realms=[
realms.Realm(),
realms.Realm(),
realms.Realm(),
],
next_page_token="abc",
),
realms.ListRealmsResponse(
realms=[],
next_page_token="def",
),
realms.ListRealmsResponse(
realms=[
realms.Realm(),
],
next_page_token="ghi",
),
realms.ListRealmsResponse(
realms=[
realms.Realm(),
realms.Realm(),
],
),
RuntimeError,
)
async_pager = await client.list_realms(
request={},
)
assert async_pager.next_page_token == "abc"
responses = []
async for response in async_pager: # pragma: no branch
responses.append(response)
assert len(responses) == 6
> assert all(isinstance(i, realms.Realm) for i in responses)
E assert False
E + where False = all(. at 0x7f0642165150>)
tests/unit/gapic/gaming_v1beta/test_realms_service.py:1032: AssertionError
This test failed!
To configure my behavior, see the Flaky Bot documentation.
If I'm commenting on this issue too often, add the
flakybot: quiet
label and I will stop commenting.commit: 7598cb6275b1a587ed6a1f63f3d209861f24a32e buildURL: Build Status, Sponge status: failed
Test output