Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use sync instead of async in test #396

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions tests/unit/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_Connector_close_called_multiple_times(credentials: FakeCredentials) ->
connector.close()


async def test_Connector_remove_cached_bad_instance(
def test_Connector_remove_cached_bad_instance(
credentials: FakeCredentials,
) -> None:
"""When a Connector attempts to retrieve connection info for a
Expand All @@ -219,14 +219,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_running_loop()
),
loop=asyncio.get_running_loop(),
)
with pytest.raises(ClientResponseError):
await connector.connect_async(instance_uri, "pg8000")
connector.connect(instance_uri, "pg8000")
assert instance_uri not in connector._cache


Expand Down
Loading