Skip to content

Commit 4e1ecc0

Browse files
committed
Fixes TestConfigureCmd unit tests.
1 parent c5bf0ba commit 4e1ecc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/unitary/with_extras/opctl/test_opctl_cmds.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TestConfigureCmd:
2020
@patch("ads.opctl.cmds.click.prompt")
2121
@patch("ads.opctl.cmds.click.confirm")
2222
def test_configure(self, confirm, prompt, monkeypatch):
23-
monkeypatch.delenv("NB_SESSION_OCID")
23+
monkeypatch.delenv("NB_SESSION_OCID", raising=False)
2424
with tempfile.TemporaryDirectory() as td:
2525
with open(os.path.join(td, "oci_config"), mode="w") as f:
2626
f.write(
@@ -160,7 +160,7 @@ def test_configure_in_notebook_session(self, confirm, prompt, monkeypatch):
160160
@patch("ads.opctl.backend.ads_ml_pipeline.PipelineBackend.watch")
161161
@patch("ads.opctl.backend.ads_ml_job.MLJobBackend.watch")
162162
def test_watch(self, job_watch_func, pipeline_watch_func, monkeypatch):
163-
monkeypatch.delenv("NB_SESSION_OCID")
163+
monkeypatch.delenv("NB_SESSION_OCID", raising=False)
164164
watch(ocid="...datasciencejobrun...")
165165
job_watch_func.assert_called()
166166
with pytest.raises(ValueError):
@@ -174,7 +174,7 @@ def test_watch(self, job_watch_func, pipeline_watch_func, monkeypatch):
174174
@patch("ads.opctl.backend.ads_ml_pipeline.PipelineBackend.cancel")
175175
@patch("ads.opctl.backend.ads_ml_job.MLJobBackend.cancel")
176176
def test_cancel(self, job_cancel_func, pipeline_cancel_func, monkeypatch):
177-
monkeypatch.delenv("NB_SESSION_OCID")
177+
monkeypatch.delenv("NB_SESSION_OCID", raising=False)
178178
cancel(ocid="...datasciencejobrun...")
179179
job_cancel_func.assert_called()
180180
with pytest.raises(ValueError):
@@ -187,7 +187,7 @@ def test_cancel(self, job_cancel_func, pipeline_cancel_func, monkeypatch):
187187

188188
@patch("ads.opctl.backend.ads_ml_job.MLJobBackend.delete")
189189
def test_delete(self, delete_func, monkeypatch):
190-
monkeypatch.delenv("NB_SESSION_OCID")
190+
monkeypatch.delenv("NB_SESSION_OCID", raising=False)
191191
delete(ocid="...datasciencejobrun...")
192192
delete_func.assert_called()
193193
delete(ocid="....datasciencejob....")

0 commit comments

Comments
 (0)