Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from pytest import Config
from pytest import Parser
from pytest_mock import MockerFixture


def pytest_addoption(parser: Parser) -> None:
Expand Down Expand Up @@ -109,3 +110,13 @@ def python(venv: Path) -> str:
@pytest.fixture()
def f() -> Factory:
return Factory()


@pytest.fixture(autouse=True)
def with_mocked_get_vcs(mocker: MockerFixture) -> None:
from poetry.core.vcs.git import Git

mocker.patch(
"poetry.core.vcs.git.Git.run", return_value="This is a mocked Git.run() output."
)
mocker.patch("poetry.core.vcs.get_vcs", return_value=Git())
6 changes: 6 additions & 0 deletions tests/vcs/test_vcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ def reset_git() -> Iterator[None]:
_reset_executable()


@pytest.fixture(autouse=True)
def with_mocked_get_vcs() -> None:
# disabled global mocking of get_vcs
pass


@pytest.mark.parametrize(
"url, normalized",
[
Expand Down
Loading