@@ -31,7 +31,7 @@ async def test_Instance_init() -> None:
3131 Test to check whether the __init__ method of Instance
3232 can tell if the instance URI that's passed in is formatted correctly.
3333 """
34- keys = generate_keys ()
34+ keys = asyncio . create_task ( generate_keys () )
3535 async with aiohttp .ClientSession () as client :
3636 instance = Instance (
3737 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
@@ -52,7 +52,7 @@ async def test_Instance_init_invalid_instant_uri() -> None:
5252 Test to check whether the __init__ method of Instance
5353 will throw error for invalid instance URI.
5454 """
55- keys = generate_keys ()
55+ keys = asyncio . create_task ( generate_keys () )
5656 async with aiohttp .ClientSession () as client :
5757 with pytest .raises (ValueError ):
5858 Instance ("invalid/instance/uri/" , client , keys )
@@ -64,7 +64,7 @@ async def test_Instance_close() -> None:
6464 Test that Instance's close method
6565 cancels tasks gracefully.
6666 """
67- keys = generate_keys ()
67+ keys = asyncio . create_task ( generate_keys () )
6868 client = FakeAlloyDBClient ()
6969 instance = Instance (
7070 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
@@ -84,7 +84,7 @@ async def test_Instance_close() -> None:
8484@pytest .mark .asyncio
8585async def test_perform_refresh () -> None :
8686 """Test that _perform refresh returns valid RefreshResult"""
87- keys = generate_keys ()
87+ keys = asyncio . create_task ( generate_keys () )
8888 client = FakeAlloyDBClient ()
8989 instance = Instance (
9090 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
@@ -104,7 +104,7 @@ async def test_schedule_refresh_replaces_result() -> None:
104104 Test to check whether _schedule_refresh replaces a valid refresh result
105105 with another refresh result.
106106 """
107- keys = generate_keys ()
107+ keys = asyncio . create_task ( generate_keys () )
108108 client = FakeAlloyDBClient ()
109109 instance = Instance (
110110 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
@@ -131,7 +131,7 @@ async def test_schedule_refresh_wont_replace_valid_result_with_invalid() -> None
131131 Test to check whether _schedule_refresh won't replace a valid
132132 refresh result with an invalid one.
133133 """
134- keys = generate_keys ()
134+ keys = asyncio . create_task ( generate_keys () )
135135 client = FakeAlloyDBClient ()
136136 instance = Instance (
137137 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
@@ -160,7 +160,7 @@ async def test_schedule_refresh_expired_cert() -> None:
160160 Test to check whether _schedule_refresh will throw RefreshError on
161161 expired certificate.
162162 """
163- keys = generate_keys ()
163+ keys = asyncio . create_task ( generate_keys () )
164164 client = FakeAlloyDBClient ()
165165 # set certificate to be expired
166166 client .instance .cert_before = datetime .now () - timedelta (minutes = 20 )
@@ -182,7 +182,7 @@ async def test_force_refresh_cancels_pending_refresh() -> None:
182182 """
183183 Test that force_refresh cancels pending task if refresh_in_progress event is not set.
184184 """
185- keys = generate_keys ()
185+ keys = asyncio . create_task ( generate_keys () )
186186 client = FakeAlloyDBClient ()
187187 instance = Instance (
188188 "projects/test-project/locations/test-region/clusters/test-cluster/instances/test-instance" ,
0 commit comments