Skip to content

Commit 7b02ce8

Browse files
chore: use exc_info for consistency
1 parent 1e2357b commit 7b02ce8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/unit/test_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ async def test_cloud_sql_error_messages_get_metadata(
169169
payload=resp_body,
170170
repeat=True,
171171
)
172-
with pytest.raises(ClientResponseError) as e:
172+
with pytest.raises(ClientResponseError) as exc_info:
173173
await client._get_metadata("my-project", "my-region", "my-instance")
174-
assert e.status == 403
174+
assert exc_info.status == 403
175175
assert (
176-
e.message
176+
exc_info.message
177177
== "Cloud SQL Admin API has not been used in project 123456789 before or it is disabled"
178178
)
179179
await client.close()
@@ -205,8 +205,8 @@ async def test_cloud_sql_error_messages_get_ephemeral(
205205
payload=resp_body,
206206
repeat=True,
207207
)
208-
with pytest.raises(ClientResponseError) as e:
208+
with pytest.raises(ClientResponseError) as exc_info:
209209
await client._get_ephemeral("my-project", "my-instance", "my-key")
210-
assert e.status == 404
211-
assert e.message == "The Cloud SQL instance does not exist."
210+
assert exc_info.status == 404
211+
assert exc_info.message == "The Cloud SQL instance does not exist."
212212
await client.close()

0 commit comments

Comments
 (0)