diff --git a/tests/func/test_api.py b/tests/func/test_api.py index 3ba71ea467..ddf101479c 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -84,13 +84,13 @@ def test_get_url(repo_dir, dvc_repo, remote_url): @pytest.mark.parametrize("remote_url", remote_params, indirect=True) -def test_get_url_external(repo_dir, dvc_repo, erepo, remote_url): +def test_get_url_external(dvc_repo, erepo, remote_url): _set_remote_url_and_commit(erepo.dvc, remote_url) # Using file url to force clone to tmp repo repo_url = "file://" + erepo.dvc.root_dir expected_url = URLInfo(remote_url) / "ac/bd18db4cc2f85cedef654fccc4a4d8" - assert api.get_url(repo_dir.FOO, repo=repo_url) == expected_url + assert api.get_url(erepo.FOO, repo=repo_url) == expected_url @pytest.mark.parametrize("remote_url", all_remote_params, indirect=True) @@ -107,7 +107,7 @@ def test_open(repo_dir, dvc_repo, remote_url): @pytest.mark.parametrize("remote_url", all_remote_params, indirect=True) -def test_open_external(repo_dir, dvc_repo, erepo, remote_url): +def test_open_external(dvc_repo, erepo, remote_url): erepo.dvc.scm.checkout("branch") _set_remote_url_and_commit(erepo.dvc, remote_url) erepo.dvc.scm.checkout("master") diff --git a/tests/func/test_get.py b/tests/func/test_get.py index 18afef5b5d..2b65d51365 100644 --- a/tests/func/test_get.py +++ b/tests/func/test_get.py @@ -14,7 +14,7 @@ from tests.utils import trees_equal -def test_get_repo_file(repo_dir, erepo): +def test_get_repo_file(erepo): src = erepo.FOO dst = erepo.FOO + "_imported" @@ -22,10 +22,10 @@ def test_get_repo_file(repo_dir, erepo): assert os.path.exists(dst) assert os.path.isfile(dst) - assert filecmp.cmp(repo_dir.FOO, dst, shallow=False) + assert filecmp.cmp(erepo.FOO, dst, shallow=False) -def test_get_repo_dir(repo_dir, erepo): +def test_get_repo_dir(erepo): src = erepo.DATA_DIR dst = erepo.DATA_DIR + "_imported" @@ -36,7 +36,7 @@ def test_get_repo_dir(repo_dir, erepo): trees_equal(src, dst) -def test_cache_type_is_properly_overridden(repo_dir, erepo): +def test_cache_type_is_properly_overridden(erepo): erepo.dvc.config.set( Config.SECTION_CACHE, Config.SECTION_CACHE_TYPE, "symlink" ) @@ -53,7 +53,7 @@ def test_cache_type_is_properly_overridden(repo_dir, erepo): assert os.path.isfile(dst) -def test_get_repo_rev(repo_dir, erepo): +def test_get_repo_rev(erepo): src = "version" dst = src @@ -70,13 +70,13 @@ def test_get_from_non_dvc_repo(git_erepo): Repo.get(git_erepo.root_dir, "some_file.zip") -def test_get_a_dvc_file(repo_dir, erepo): +def test_get_a_dvc_file(erepo): with pytest.raises(GetDVCFileError): Repo.get(erepo.root_dir, "some_file.dvc") @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"]) -def test_get_to_dir(dname, repo_dir, erepo): +def test_get_to_dir(dname, erepo): src = erepo.FOO makedirs(dname, exist_ok=True) @@ -86,4 +86,4 @@ def test_get_to_dir(dname, repo_dir, erepo): dst = os.path.join(dname, os.path.basename(src)) assert os.path.isdir(dname) - assert filecmp.cmp(repo_dir.FOO, dst, shallow=False) + assert filecmp.cmp(erepo.FOO, dst, shallow=False) diff --git a/tests/func/test_import.py b/tests/func/test_import.py index 067d5be8eb..6c9a956c5b 100644 --- a/tests/func/test_import.py +++ b/tests/func/test_import.py @@ -15,7 +15,7 @@ from tests.utils import trees_equal -def test_import(repo_dir, git, dvc_repo, erepo): +def test_import(git, dvc_repo, erepo): src = erepo.FOO dst = erepo.FOO + "_imported" @@ -23,11 +23,11 @@ def test_import(repo_dir, git, dvc_repo, erepo): assert os.path.exists(dst) assert os.path.isfile(dst) - assert filecmp.cmp(repo_dir.FOO, dst, shallow=False) + assert filecmp.cmp(erepo.FOO, dst, shallow=False) assert git.git.check_ignore(dst) -def test_import_dir(repo_dir, git, dvc_repo, erepo): +def test_import_dir(git, dvc_repo, erepo): src = erepo.DATA_DIR dst = erepo.DATA_DIR + "_imported" @@ -39,7 +39,7 @@ def test_import_dir(repo_dir, git, dvc_repo, erepo): assert git.git.check_ignore(dst) -def test_import_rev(repo_dir, git, dvc_repo, erepo): +def test_import_rev(git, dvc_repo, erepo): src = "version" dst = src @@ -70,7 +70,7 @@ def test_pull_imported_stage(dvc_repo, erepo): assert os.path.isfile(dst_cache) -def test_cache_type_is_properly_overridden(repo_dir, git, dvc_repo, erepo): +def test_cache_type_is_properly_overridden(git, dvc_repo, erepo): erepo.dvc.config.set( Config.SECTION_CACHE, Config.SECTION_CACHE_TYPE, "symlink" ) @@ -85,7 +85,7 @@ def test_cache_type_is_properly_overridden(repo_dir, git, dvc_repo, erepo): assert not System.is_symlink(dst) assert os.path.exists(dst) assert os.path.isfile(dst) - assert filecmp.cmp(repo_dir.FOO, dst, shallow=False) + assert filecmp.cmp(erepo.FOO, dst, shallow=False) assert git.git.check_ignore(dst) @@ -125,7 +125,7 @@ def test_download_error_pulling_imported_stage(dvc_repo, erepo): @pytest.mark.parametrize("dname", [".", "dir", "dir/subdir"]) -def test_import_to_dir(dname, repo_dir, dvc_repo, erepo): +def test_import_to_dir(dname, dvc_repo, erepo): src = erepo.FOO makedirs(dname, exist_ok=True) @@ -136,7 +136,7 @@ def test_import_to_dir(dname, repo_dir, dvc_repo, erepo): assert stage.outs[0].fspath == os.path.abspath(dst) assert os.path.isdir(dname) - assert filecmp.cmp(repo_dir.FOO, dst, shallow=False) + assert filecmp.cmp(erepo.FOO, dst, shallow=False) def test_pull_non_workspace(git, dvc_repo, erepo):