mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
testing: sanitize venv names containing slashes
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
981baa8c30
commit
c75a5583b3
@@ -20,12 +20,17 @@ def bench_config(request):
|
||||
@pytest.fixture(scope="session")
|
||||
def make_dvc_venv(tmp_path_factory):
|
||||
def _make_dvc_venv(name):
|
||||
name = _sanitize_venv_name(name)
|
||||
venv_dir = tmp_path_factory.mktemp(f"dvc-venv-{name}")
|
||||
return VirtualEnv(workspace=venv_dir)
|
||||
|
||||
return _make_dvc_venv
|
||||
|
||||
|
||||
def _sanitize_venv_name(name):
|
||||
return name.replace("/", "-").replace("\\", "-")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def dvc_venvs():
|
||||
return {}
|
||||
|
||||
Reference in New Issue
Block a user