Skip to content

Commit

Permalink
testing: Lazy import pytest_virtualenv (iterative#9469)
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo authored May 17, 2023
1 parent 7f6890f commit e6e3912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dvc/testing/benchmarks/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dulwich.porcelain import clone
from funcy import first
from packaging import version
from pytest_virtualenv import VirtualEnv

# pylint: disable=redefined-outer-name,unused-argument

Expand All @@ -20,6 +19,8 @@ def bench_config(request):
@pytest.fixture(scope="session")
def make_dvc_venv(tmp_path_factory):
def _make_dvc_venv(name):
from pytest_virtualenv import VirtualEnv

name = _sanitize_venv_name(name)
venv_dir = tmp_path_factory.mktemp(f"dvc-venv-{name}")
return VirtualEnv(workspace=venv_dir)
Expand Down

0 comments on commit e6e3912

Please sign in to comment.