Skip to content

Commit

Permalink
fix some tests (python-poetry#8654)
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored and MrGreenTea committed Dec 18, 2023
1 parent a1110a2 commit b2efa8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions tests/console/commands/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest

from poetry.packages import Locker
from poetry.toml import TOMLFile


if TYPE_CHECKING:
Expand Down Expand Up @@ -67,8 +68,6 @@ def test_check_valid(tester: CommandTester) -> None:
def test_check_invalid(
mocker: MockerFixture, tester: CommandTester, fixture_dir: FixtureDirGetter
) -> None:
from poetry.toml import TOMLFile

mocker.patch(
"poetry.poetry.Poetry.file",
return_value=TOMLFile(fixture_dir("invalid_pyproject") / "pyproject.toml"),
Expand Down Expand Up @@ -107,8 +106,9 @@ def test_check_private(
mocker: MockerFixture, tester: CommandTester, fixture_dir: FixtureDirGetter
) -> None:
mocker.patch(
"poetry.factory.Factory.locate",
return_value=fixture_dir("private_pyproject") / "pyproject.toml",
"poetry.poetry.Poetry.file",
return_value=TOMLFile(fixture_dir("private_pyproject") / "pyproject.toml"),
new_callable=mocker.PropertyMock,
)

tester.execute()
Expand All @@ -135,8 +135,6 @@ def test_check_lock_missing(
expected: str,
expected_status: int,
) -> None:
from poetry.toml import TOMLFile

mocker.patch(
"poetry.poetry.Poetry.file",
return_value=TOMLFile(fixture_dir("private_pyproject") / "pyproject.toml"),
Expand Down
2 changes: 1 addition & 1 deletion tests/console/commands/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def test_install_logs_output_decorated(
assert tester.io.fetch_output() == expected


@pytest.mark.parametrize("with_root", [True])
@pytest.mark.parametrize("with_root", [True, False])
@pytest.mark.parametrize("error", ["module", "readme", ""])
def test_install_warning_corrupt_root(
command_tester_factory: CommandTesterFactory,
Expand Down

0 comments on commit b2efa8b

Please sign in to comment.