test: drop repo_template fixture

This commit is contained in:
Alexander Schepanovski
2020-01-20 11:49:13 +07:00
parent 7d65002bf0
commit 4117206c67
3 changed files with 9 additions and 20 deletions
+1 -14
View File
@@ -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(
+3 -1
View File
@@ -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")
+5 -5
View File
@@ -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")