mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Update duplicate output error msg (#9138)
* update dup output error msg * update dup output error msg * stage add: add test for duplicated output error msg * cleanup OutputDuplicationError code
This commit is contained in:
@@ -4,6 +4,7 @@ import pytest
|
||||
|
||||
from dvc.annotations import Annotation
|
||||
from dvc.dvcfile import SingleStageFile
|
||||
from dvc.exceptions import OutputDuplicationError
|
||||
from dvc.fs import LocalFileSystem
|
||||
from dvc.output import Output
|
||||
from dvc.repo import Repo, lock_repo
|
||||
@@ -333,3 +334,14 @@ def test_stage_run_checkpoint(tmp_dir, dvc, mocker, checkpoint):
|
||||
mock_cmd_run.assert_called_with(
|
||||
stage, checkpoint_func=callback, dry=False, run_env=None
|
||||
)
|
||||
|
||||
|
||||
def test_stage_add_duplicated_output(tmp_dir, dvc):
|
||||
tmp_dir.dvc_gen("foo", "foo")
|
||||
dvc.add("foo")
|
||||
|
||||
with pytest.raises(
|
||||
OutputDuplicationError,
|
||||
match="Use `dvc remove foo.dvc` to stop tracking the overlapping output.",
|
||||
):
|
||||
dvc.stage.add(name="duplicated", cmd="echo bar > foo", outs=["foo"])
|
||||
|
||||
Reference in New Issue
Block a user