Skip to content
Open
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
7 changes: 7 additions & 0 deletions google/genai/tests/pytest_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ def base_test_function(
assert False, 'Should have raised exception in Vertex.'
client._api_client.close()
except Exception as e:
# Gracefully skip the test if we hit a live API quota limit
if getattr(e, 'code', None) == 429 and client._api_client._mode == 'api':
pytest.skip(
'Resource Exhausted (429). Skipping test instead of'
f' failing: {e}'
)

if test_table_item.exception_if_mldev and not client._api_client.vertexai:
if test_table_item.exception_if_mldev not in str(e):
raise AssertionError(
Expand Down
Loading