Commit a0904f95 by Arun Babu Neelicattu

tests: move tmp_venv fixture to conftest

parent d47b5285
...@@ -11,6 +11,8 @@ import pytest ...@@ -11,6 +11,8 @@ import pytest
from poetry.config.config import Config as BaseConfig from poetry.config.config import Config as BaseConfig
from poetry.config.dict_config_source import DictConfigSource from poetry.config.dict_config_source import DictConfigSource
from poetry.utils._compat import Path from poetry.utils._compat import Path
from poetry.utils.env import EnvManager
from poetry.utils.env import VirtualEnv
from tests.helpers import mock_clone from tests.helpers import mock_clone
from tests.helpers import mock_download from tests.helpers import mock_download
...@@ -122,3 +124,15 @@ def tmp_dir(): ...@@ -122,3 +124,15 @@ def tmp_dir():
yield dir_ yield dir_
shutil.rmtree(dir_) shutil.rmtree(dir_)
@pytest.fixture
def tmp_venv(tmp_dir):
venv_path = Path(tmp_dir) / "venv"
EnvManager.build_venv(str(venv_path))
venv = VirtualEnv(venv_path)
yield venv
shutil.rmtree(str(venv.path))
...@@ -60,18 +60,6 @@ def manager(poetry): ...@@ -60,18 +60,6 @@ def manager(poetry):
return EnvManager(poetry) return EnvManager(poetry)
@pytest.fixture
def tmp_venv(tmp_dir, manager):
venv_path = Path(tmp_dir) / "venv"
manager.build_venv(str(venv_path))
venv = VirtualEnv(venv_path)
yield venv
shutil.rmtree(str(venv.path))
def test_virtualenvs_with_spaces_in_their_path_work_as_expected(tmp_dir, manager): def test_virtualenvs_with_spaces_in_their_path_work_as_expected(tmp_dir, manager):
venv_path = Path(tmp_dir) / "Virtual Env" venv_path = Path(tmp_dir) / "Virtual Env"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment