mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
test: drop repo_template fixture
This commit is contained in:
+1
-14
@@ -54,15 +54,7 @@ from dvc.utils.fs import makedirs
|
||||
from dvc.compat import fspath, fspath_py35
|
||||
|
||||
|
||||
__all__ = ["tmp_dir", "scm", "dvc", "repo_template", "run_copy", "erepo_dir"]
|
||||
REPO_TEMPLATE = {
|
||||
"foo": "foo",
|
||||
"bar": "bar",
|
||||
"dir": {
|
||||
"data": "dir/data text",
|
||||
"subdir": {"subdata": "dir/subdir/subdata text"},
|
||||
},
|
||||
}
|
||||
__all__ = ["tmp_dir", "scm", "dvc", "run_copy", "erepo_dir"]
|
||||
|
||||
|
||||
class TmpDir(pathlib.Path):
|
||||
@@ -236,11 +228,6 @@ def dvc(tmp_dir, request):
|
||||
dvc.close()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def repo_template(tmp_dir):
|
||||
tmp_dir.gen(REPO_TEMPLATE)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def run_copy(tmp_dir, dvc, request):
|
||||
tmp_dir.gen(
|
||||
|
||||
@@ -463,7 +463,9 @@ class TestAddFilename(TestDvc):
|
||||
self.assertFalse(os.path.exists("foo.dvc"))
|
||||
|
||||
|
||||
def test_should_cleanup_after_failed_add(tmp_dir, scm, dvc, repo_template):
|
||||
def test_failed_add_cleanup(tmp_dir, scm, dvc):
|
||||
tmp_dir.gen({"foo": "foo", "bar": "bar"})
|
||||
|
||||
# Add and corrupt a stage file
|
||||
dvc.add("foo")
|
||||
tmp_dir.gen("foo.dvc", "- broken\nyaml")
|
||||
|
||||
@@ -189,9 +189,9 @@ def test_all_commits(tmp_dir, scm, dvc):
|
||||
assert _count_files(dvc.cache.local.cache_dir) == n - 1
|
||||
|
||||
|
||||
def test_gc_no_dir_cache(tmp_dir, dvc, repo_template):
|
||||
dvc.add(["foo", "bar"])
|
||||
dir_stage, = dvc.add("dir")
|
||||
def test_gc_no_dir_cache(tmp_dir, dvc):
|
||||
tmp_dir.dvc_gen({"foo": "foo", "bar": "bar"})
|
||||
dir_stage, = tmp_dir.dvc_gen({"dir": {"x": "x", "subdir": {"y": "y"}}})
|
||||
|
||||
os.unlink(dir_stage.outs[0].cache_path)
|
||||
|
||||
@@ -207,8 +207,8 @@ def _count_files(path):
|
||||
return sum(len(files) for _, _, files in os.walk(path))
|
||||
|
||||
|
||||
def test_gc_no_unpacked_dir(tmp_dir, dvc, repo_template):
|
||||
dir_stages = dvc.add("dir")
|
||||
def test_gc_no_unpacked_dir(tmp_dir, dvc):
|
||||
dir_stages = tmp_dir.dvc_gen({"dir": {"file": "text"}})
|
||||
dvc.status()
|
||||
|
||||
os.remove("dir.dvc")
|
||||
|
||||
Reference in New Issue
Block a user