Skip to content

Commit

Permalink
[Tests] Fix test_jobs (#2651)
Browse files Browse the repository at this point in the history
* fix

* cahnge to monkeypatch
  • Loading branch information
cblmemo authored Dec 28, 2023
1 parent 5e9ebb8 commit 61086d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def _get_az_mappings(_):
'sky.clouds.utils.gcp_utils.list_reservations_for_instance_type_in_zone',
lambda *_args, **_kwargs: [])

for cloud in enabled_clouds:
if hasattr(cloud, 'check_quota_available'):
attr = (f'{cloud.__module__}.{cloud.__class__.__name__}.'
'check_quota_available')
monkeypatch.setattr(attr, lambda *_args, **_kwargs: True)

# Monkey patch Kubernetes resource detection since it queries
# the cluster to detect available cluster resources.
monkeypatch.setattr(
Expand Down

0 comments on commit 61086d5

Please sign in to comment.