3838
3939
4040@pytest .fixture
41- def test_rate_limiter (event_loop : asyncio . AbstractEventLoop ) -> AsyncRateLimiter :
42- return AsyncRateLimiter (max_capacity = 1 , rate = 1 / 2 , loop = event_loop )
41+ def test_rate_limiter () -> AsyncRateLimiter :
42+ return AsyncRateLimiter (max_capacity = 1 , rate = 1 / 2 )
4343
4444
4545@pytest .mark .asyncio
4646async def test_Instance_init (
47- fake_credentials : Credentials , event_loop : asyncio . AbstractEventLoop
47+ fake_credentials : Credentials ,
4848) -> None :
4949 """
5050 Test to check whether the __init__ method of Instance
5151 can tell if the connection string that's passed in is formatted correctly.
5252 """
53-
53+ event_loop = asyncio . get_running_loop ()
5454 connect_string = "test-project:test-region:test-instance"
5555 keys = asyncio .wrap_future (
5656 asyncio .run_coroutine_threadsafe (generate_keys (), event_loop ), loop = event_loop
@@ -71,13 +71,12 @@ async def test_Instance_init(
7171
7272
7373@pytest .mark .asyncio
74- async def test_Instance_init_bad_credentials (
75- event_loop : asyncio .AbstractEventLoop ,
76- ) -> None :
74+ async def test_Instance_init_bad_credentials () -> None :
7775 """
7876 Test to check whether the __init__ method of Instance
7977 throws proper error for bad credentials arg type.
8078 """
79+ event_loop = asyncio .get_running_loop ()
8180 connect_string = "test-project:test-region:test-instance"
8281 keys = asyncio .wrap_future (
8382 asyncio .run_coroutine_threadsafe (generate_keys (), event_loop ), loop = event_loop
@@ -331,11 +330,12 @@ async def test_get_preferred_ip_CloudSQLIPTypeError(instance: Instance) -> None:
331330
332331@pytest .mark .asyncio
333332async def test_ClientResponseError (
334- fake_credentials : Credentials , event_loop : asyncio . AbstractEventLoop
333+ fake_credentials : Credentials ,
335334) -> None :
336335 """
337336 Test that detailed error message is applied to ClientResponseError.
338337 """
338+ event_loop = asyncio .get_running_loop ()
339339 # mock Cloud SQL Admin API calls with exceptions
340340 keys = asyncio .wrap_future (
341341 asyncio .run_coroutine_threadsafe (generate_keys (), event_loop ), loop = event_loop
0 commit comments