Skip to content

Commit

Permalink
Add test_log_artifact_type_model_when_dvc_add_fails (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo authored Jun 23, 2023
1 parent 5d51f26 commit ea4a73d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_log_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,14 @@ def test_log_artifact_attrs(tmp_dir, mocked_dvc_repo):
"foo": {"path": "../model.pth", **attrs},
}
}


def test_log_artifact_type_model_when_dvc_add_fails(tmp_dir, mocker, mocked_dvc_repo):
(tmp_dir / "model.pth").touch()
mocked_dvc_repo.add.side_effect = Exception
with Live(save_dvc_exp=True) as live:
live.log_artifact("model.pth", type="model")

assert load_yaml(live.dvc_file) == {
"artifacts": {"model": {"path": "../model.pth", "type": "model"}}
}

0 comments on commit ea4a73d

Please sign in to comment.