Consolidate all package handling logic into hook module

This creates a large module to sort through, but the hope is that it
avoids the need to constantly hop around without rhyme or reason to
find the piece of logic you're looking for. The module structure is
mapped to functionality rather than an arbitrary concept of reducing
line number.
This commit is contained in:
2024-08-13 13:44:25 -04:00
committed by Ethan Paul
parent f3ae242cf7
commit 5c4d861230
6 changed files with 157 additions and 148 deletions

View File

@@ -10,7 +10,7 @@ import pytest
import tox.tox_env.python.virtual_env.runner
from poetry.installation.operations.operation import Operation
from tox_poetry_installer import utilities
import tox_poetry_installer.hooks._tox_on_install_helpers
TEST_PROJECT_PATH = Path(__file__).parent.resolve() / "test-project"
@@ -47,7 +47,11 @@ class MockExecutor:
@pytest.fixture
def mock_venv(monkeypatch):
monkeypatch.setattr(utilities, "convert_virtualenv", lambda venv: venv)
monkeypatch.setattr(
tox_poetry_installer.hooks._tox_on_install_helpers,
"convert_virtualenv",
lambda venv: venv,
)
monkeypatch.setattr(poetry.installation.executor, "Executor", MockExecutor)
monkeypatch.setattr(
tox.tox_env.python.virtual_env.runner, "VirtualEnvRunner", MockVirtualEnv