Skip to content

Test failures with poetry 2.2.0 #78

@dotlambda

Description

@dotlambda
============================= test session starts ==============================
platform linux -- Python 3.13.7, pytest-8.4.1, pluggy-1.6.0
rootdir: /build/source
configfile: pyproject.toml
plugins: mock-3.14.1, anyio-4.10.0
collected 53 items                                                             

tests/e2e/test_e2e.py ...s.......F....F.                                 [ 33%]
tests/integration/test_integration.py .....                              [ 43%]
tests/unit/test_unit.py ..............................                   [100%]

=================================== FAILURES ===================================
_______________________ test_command_with_latest_project _______________________

patch_path_is_file = None
app_tester_v2 = <cleo.testers.application_tester.ApplicationTester object at 0x7ffff3778410>
packages = [Package('foo', '2.2.2'), Package('bar', '2.2.2'), Package('baz', '2.2.2'), Package('corge', '2.2.2'), Package('grault', '2.2.2'), Package('garply', '2.2.2'), ...]
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffff36e1bf0>
project_path_v2 = PosixPath('/build/source/tests/fixtures/simple_project_poetry_v2')
tmp_pyproject_path_v2 = PosixPath('/build/pytest-of-nixbld/pytest-0/simple_project_poetry_v20/pyproject.toml')

    @poetry_v2
    def test_command_with_latest_project(
        patch_path_is_file: None,
        app_tester_v2: ApplicationTester,
        packages: List[Package],
        mocker: MockerFixture,
        project_path_v2: Path,
        tmp_pyproject_path_v2: Path,
    ) -> None:
        command_call = mocker.patch(
            "poetry.console.commands.command.Command.call",
            return_value=0,
        )
        mocker.patch(
            "poetry.version.version_selector.VersionSelector.find_best_candidate",
            side_effect=packages,
        )
        mocker.patch(
            "poetry.console.commands.installer_command.InstallerCommand.reset_poetry",  # noqa: E501
            return_value=None,
        )
    
        path = project_path_v2 / "expected_pyproject_with_latest.toml"
        expected = PyProjectTOML(path).file.read()
    
        assert app_tester_v2.execute("up --latest") == 0
        print(PyProjectTOML(tmp_pyproject_path_v2).file.read())
        print(expected)
>       assert PyProjectTOML(tmp_pyproject_path_v2).file.read() == expected
E       AssertionError: assert {'project': {....2,<3.0.0)']}} == {'project': {...1.1,<2.0.0']}}
E         
E         Omitting 1 identical items, use -vv to show
E         Differing items:
E         {'dependency-groups': {'dev': ['fred==1.1.1', 'plugh (>=2.2.2,<3.0.0)', 'xyzzy (>=2.2.2,<3.0.0)', 'nacho (>=2.2.2,<3.0....2,<3.0.0)', 'foobaz (>=2.2.2)', 'f...
E         
E         ...Full output truncated (2 lines hidden), use '-vv' to show

tests/e2e/test_e2e.py:285: AssertionError
------------------------------ Captured log setup ------------------------------
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
----------------------------- Captured stdout call -----------------------------
{'project': {'name': 'simple-project', 'version': '1.2.3', 'description': 'Some description.', 'authors': [{'name': 'Mousa Zeid Baker'}], 'license': 'MIT', 'requires-python': '>=3.7,<4.0', 'dependencies': ['foo (>=2.2.2,<3.0.0)', 'bar (>=2.2.2,<3.0.0)', 'baz[quux,qux] (>=2.2.2,<3.0.0)', 'grault (>=2.2.2,<3.0.0)', 'garply @ file:///absolute/path/to/my-package/dist/garply-0.1.0.tar.gz', 'waldo @ git+https://example.com/test/project.git'], 'optional-dependencies': {'extras': ['corge (>=2.2.2,<3.0.0)']}}, 'dependency-groups': {'dev': ['fred==1.1.1', 'plugh (>=2.2.2,<3.0.0)', 'xyzzy (>=2.2.2,<3.0.0)', 'nacho (>=2.2.2,<3.0.0)', 'thud (>=2.2.2,<3.0.0)'], 'docs': ['foobar (>=2.2.2,<3.0.0)', 'foobaz (>=2.2.2)', 'fooqux (>=2.2.2,<3.0.0)', 'fooquux (>=2.2.2,<3.0.0)', 'Foo_Corge (>=2.2.2,<3.0.0)']}}
{'project': {'name': 'simple-project', 'version': '1.2.3', 'description': 'Some description.', 'authors': [{'name': 'Mousa Zeid Baker'}], 'license': 'MIT', 'requires-python': '>=3.7,<4.0', 'dependencies': ['foo (>=2.2.2,<3.0.0)', 'bar (>=2.2.2,<3.0.0)', 'baz[quux,qux] (>=2.2.2,<3.0.0)', 'grault (>=2.2.2,<3.0.0)', 'garply @ file:///absolute/path/to/my-package/dist/garply-0.1.0.tar.gz', 'waldo @ git+https://example.com/test/project.git'], 'optional-dependencies': {'extras': ['corge (>=2.2.2,<3.0.0)']}}, 'dependency-groups': {'dev': ['fred==1.1.1', 'plugh>=1.1.1,<2.0.0', 'xyzzy>=1.1.1,<1.2.0', 'nacho<1.1.1', 'thud>1.1.1'], 'docs': ['foobar<=1.1.1', 'foobaz>=1.1.1', 'fooqux!=1.1.1', 'fooquux', 'Foo_Corge>=1.1.1,<2.0.0']}}
------------------------------ Captured log call -------------------------------
WARNING  virtualenv.seed.embed.base_embed:base_embed.py:38 The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
____________________ test_command_preserve_wildcard_project ____________________

app_tester_v2 = <cleo.testers.application_tester.ApplicationTester object at 0x7ffff34d2150>
packages = [Package('foo', '2.2.2'), Package('bar', '2.2.2'), Package('baz', '2.2.2'), Package('corge', '2.2.2'), Package('grault', '2.2.2'), Package('garply', '2.2.2'), ...]
mocker = <pytest_mock.plugin.MockerFixture object at 0x7ffff35ea7b0>
project_path_v2 = PosixPath('/build/source/tests/fixtures/simple_project_poetry_v2')
tmp_pyproject_path_v2 = PosixPath('/build/pytest-of-nixbld/pytest-0/simple_project_poetry_v24/pyproject.toml')

    @poetry_v2
    def test_command_preserve_wildcard_project(
        app_tester_v2: ApplicationTester,
        packages: List[Package],
        mocker: MockerFixture,
        project_path_v2: Path,
        tmp_pyproject_path_v2: Path,
    ) -> None:
        command_call = mocker.patch(
            "poetry.console.commands.command.Command.call",
            return_value=0,
        )
        mocker.patch(
            "poetry.version.version_selector.VersionSelector.find_best_candidate",
            side_effect=packages,
        )
        mocker.patch(
            "poetry.console.commands.installer_command.InstallerCommand.reset_poetry",  # noqa: E501
            return_value=None,
        )
    
        path = (
            project_path_v2
            / "expected_pyproject_with_latest_and_preserve_wildcard.toml"
        )
        expected = PyProjectTOML(path).file.read()
    
        assert app_tester_v2.execute("up --latest --preserve-wildcard") == 0
>       assert PyProjectTOML(tmp_pyproject_path_v2).file.read() == expected
E       AssertionError: assert {'project': {....2,<3.0.0)']}} == {'project': {...1.1,<2.0.0']}}
E         
E         Omitting 1 identical items, use -vv to show
E         Differing items:
E         {'dependency-groups': {'dev': ['fred==1.1.1', 'plugh (>=2.2.2,<3.0.0)', 'xyzzy (>=2.2.2,<3.0.0)', 'nacho (>=2.2.2,<3.0...: ['foobar (>=2.2.2,<3.0.0)'
E         
E         ...Full output truncated (2 lines hidden), use '-vv' to show

tests/e2e/test_e2e.py:386: AssertionError
------------------------------ Captured log setup ------------------------------
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
------------------------------ Captured log call -------------------------------
WARNING  virtualenv.seed.embed.base_embed:base_embed.py:38 The --no-wheel and --wheel options are deprecated. They have no effect for Python > 3.8 as wheel is no longer bundled in virtualenv.
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
WARNING  poetry.core.packages.path_dependency:path_dependency.py:83 Path /absolute/path/to/my-package/dist/garply-0.1.0.tar.gz for garply does not exist
=========================== short test summary info ============================
FAILED tests/e2e/test_e2e.py::test_command_with_latest_project - AssertionError: assert {'project': {....2,<3.0.0)']}} == {'project': {...1....
FAILED tests/e2e/test_e2e.py::test_command_preserve_wildcard_project - AssertionError: assert {'project': {....2,<3.0.0)']}} == {'project': {...1....
=================== 2 failed, 50 passed, 1 skipped in 11.31s ===================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions