Skip to content

[poetry-core] test_invalid_requirement[name @ file:.-invalid URL] failing with Python 3.12.6 #9678

@mweinelt

Description

@mweinelt

Description

We are running the poetry-core 1.9.0 test suite in nixpkgs and after upgrading Python to 3.12.6 we saw the following test failure:

_____________ test_invalid_requirement[name @ file:.-invalid URL] ______________

string = 'name @ file:.', exception = 'invalid URL'

    @pytest.mark.parametrize(
        ["string", "exception"],
        [
            ("foo!", "Unexpected character at column 4\n\nfoo!\n   ^\n"),
            ("foo (>=bar)", 'invalid version constraint ">=bar"'),
            ("name @ file:.", "invalid URL"),
            ("name @ file:/.", "invalid URL"),
        ],
    )
    def test_invalid_requirement(string: str, exception: str) -> None:
>       with pytest.raises(
            InvalidRequirement,
            match=re.escape(f"The requirement is invalid: {exception}"),
        ):
E       Failed: DID NOT RAISE <class 'poetry.core.version.requirements.InvalidRequirement'>

tests/version/test_requirements.py:130: Failed

This is likely a result of python/cpython#85110.

Workarounds

n/a

Poetry Installation Method

system package manager (eg: dnf, apt etc.)

Operating System

NixOS unstable

Poetry Version

1.8.3

Poetry Configuration

n/a

Python Sysconfig

n/a

Example pyproject.toml

n/a

Poetry Runtime Logs

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions