diff --git a/dvc/repo/pull.py b/dvc/repo/pull.py index 7c92588247..d455fe4a34 100644 --- a/dvc/repo/pull.py +++ b/dvc/repo/pull.py @@ -24,6 +24,7 @@ def pull( with_deps=with_deps, recursive=recursive, ) + # This throws CheckoutError self._checkout( targets=targets, with_deps=with_deps, force=force, recursive=recursive ) diff --git a/tests/func/test_import.py b/tests/func/test_import.py index 0d1f17e996..3994a38e4c 100644 --- a/tests/func/test_import.py +++ b/tests/func/test_import.py @@ -2,6 +2,7 @@ import os import filecmp +import shutil import pytest from mock import patch @@ -84,6 +85,12 @@ def test_download_error_pulling_imported_stage(dvc_repo, erepo): ), pytest.raises(DownloadError): dvc_repo.pull(["foo_imported.dvc"]) + # When repo is absent we should still get DownloadError + shutil.rmtree(erepo.dvc.cache.local.cache_dir) + + with pytest.raises(DownloadError): + dvc_repo.pull(["foo_imported.dvc"]) + @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"]) def test_import_to_dir(dname, repo_dir, dvc_repo, erepo):