Skip to content

Commit

Permalink
Fix failing integration test to handle exception groups
Browse files Browse the repository at this point in the history
  • Loading branch information
linkous8 committed May 7, 2024
1 parent af21fcc commit bd69980
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/connectors/kubernetes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Annotated, Type

import aiohttp
import httpx
import kubetest.client
from kubetest.objects import Deployment as KubetestDeployment
Expand Down Expand Up @@ -1553,7 +1554,12 @@ async def test_bad_request_error_handled_gracefully(
assert "no tuning pod exists, ignoring destroy" in messages[-30:]
# Check error
assert "quantities must match the regular expression" in str(error.value)
assert error.value.__cause__.status == 400
top_cause = unwrap_exception_group(
error.value.__cause__, aiohttp.ClientResponseError
)
if isinstance(top_cause, list):
top_cause = top_cause[0]
assert top_cause.status == 400

async def test_adjust_tuning_cpu_with_settlement(
self, tuning_config, namespace, kube
Expand Down

0 comments on commit bd69980

Please sign in to comment.