Skip to content

Commit

Permalink
testing: sanitize venv names containing slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed May 9, 2023
1 parent 981baa8 commit c75a558
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dvc/testing/benchmarks/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit c75a558

Please sign in to comment.