This commit is contained in:
Dave Berenbaum
2024-05-23 14:26:42 -04:00
committed by Dave Berenbaum
parent 856c902b65
commit 1f7733fec1
2 changed files with 35 additions and 13 deletions
+18
View File
@@ -1,5 +1,7 @@
import os
import pytest
from dvc.stage.cache import RunCacheNotSupported
from dvc.utils.fs import remove
@@ -81,3 +83,19 @@ def test_repro_pulls_persisted_output(tmp_dir, dvc, mocker, local_remote):
# stage is skipped
assert not dvc.reproduce(pull=True)
@pytest.mark.parametrize("allow_missing", [True, False])
def test_repro_pulls_allow_missing(tmp_dir, dvc, mocker, local_remote, allow_missing):
tmp_dir.dvc_gen("foo", "foo")
dvc.push()
dvc.stage.add(name="copy-foo", cmd="cp foo bar", deps=["foo"], outs=["bar"])
dvc.reproduce()
remove("foo")
# stage is skipped
assert not dvc.reproduce(pull=True, allow_missing=allow_missing)
# data only pulled if allow_missing is false
assert (tmp_dir / "foo").exists() != allow_missing