Skip to content

Commit

Permalink
Replace get_event_loop with get_running_loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rhatgadkar-goog committed Nov 15, 2024
1 parent 8efac50 commit 54dd99c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ async def test_Connector_remove_cached_bad_instance(
instance_uri = "projects/test-project/locations/test-region/clusters/test-cluster/instances/bad-test-instance"
with Connector(credentials) as connector:
connector._keys = asyncio.wrap_future(
asyncio.run_coroutine_threadsafe(generate_keys(), asyncio.get_event_loop()),
loop=asyncio.get_event_loop(),
asyncio.run_coroutine_threadsafe(generate_keys(), asyncio.get_running_loop()),
loop=asyncio.get_running_loop(),
)
with pytest.raises(ClientResponseError):
await connector.connect_async(instance_uri, "pg8000")
Expand All @@ -240,8 +240,8 @@ async def test_Connector_remove_cached_no_ip_type(credentials: FakeCredentials)
with Connector(credentials=credentials) as connector:
connector._client = fake_client
connector._keys = asyncio.wrap_future(
asyncio.run_coroutine_threadsafe(generate_keys(), asyncio.get_event_loop()),
loop=asyncio.get_event_loop(),
asyncio.run_coroutine_threadsafe(generate_keys(), asyncio.get_running_loop()),
loop=asyncio.get_running_loop(),
)
cache = RefreshAheadCache(instance_uri, fake_client, connector._keys)
connector._cache[instance_uri] = cache
Expand Down

0 comments on commit 54dd99c

Please sign in to comment.