Compare commits

...
3 Commits
Author SHA1 Message Date
Ruslan Kuprieiev b6d231f9cf testing: import virtualenv lazily
Fixes https://github.com/iterative/dvc/issues/10118
2023-11-28 22:20:34 +02:00
Ruslan Kuprieiev 322fcec5ca bench: test_sharing: use fetch instead of pull 2023-11-28 19:31:32 +02:00
Ruslan Kuprieiev 1e5b3603cc bench: test fetch instead of pull
`pull` is literally `fetch` + `checkout` and our main interest there is downloading, so let's just test fetch instead.
2023-11-28 19:31:32 +02:00
4 changed files with 8 additions and 6 deletions
@@ -0,0 +1,3 @@
def test_fetch(bench_dvc, tmp_dir, dvc, make_dataset, remote):
make_dataset(cache=False, dvcfile=True, files=False, remote=True)
bench_dvc("fetch")
@@ -1,3 +0,0 @@
def test_pull(bench_dvc, tmp_dir, dvc, make_dataset, remote):
make_dataset(cache=False, dvcfile=True, files=False, remote=True)
bench_dvc("pull")
@@ -11,7 +11,8 @@ def test_sharing(bench_dvc, tmp_dir, dvc, dataset, remote):
shutil.rmtree(dataset)
shutil.rmtree(tmp_dir / ".dvc" / "cache")
bench_dvc("pull")
bench_dvc("pull", name="noop")
bench_dvc("fetch")
bench_dvc("fetch", name="noop")
bench_dvc("checkout")
bench_dvc("checkout", name="noop")
+2 -1
View File
@@ -5,7 +5,6 @@ from subprocess import check_output
from typing import Dict, Optional
import pytest
import virtualenv
from dulwich.porcelain import clone
from funcy import first
from packaging import version
@@ -24,6 +23,8 @@ class VirtualEnv:
self.bin = self.path / ("Scripts" if os.name == "nt" else "bin")
def create(self) -> None:
import virtualenv
virtualenv.cli_run([os.fspath(self.path)])
def run(self, cmd: str, *args: str, env: Optional[Dict[str, str]] = None) -> None: