Commit f9e83345 by Arun Babu Neelicattu

tests/factory: fix python constraint check

This change ensures that python_version comparison uses parsed versions
and does not fail with changes in pretty output.
parent 14b27b54
...@@ -8,6 +8,7 @@ import pytest ...@@ -8,6 +8,7 @@ import pytest
from entrypoints import EntryPoint from entrypoints import EntryPoint
from poetry.core.semver.helpers import parse_constraint
from poetry.core.toml.file import TOMLFile from poetry.core.toml.file import TOMLFile
from poetry.factory import Factory from poetry.factory import Factory
from poetry.plugins.plugin import Plugin from poetry.plugins.plugin import Plugin
...@@ -70,7 +71,7 @@ def test_create_poetry(): ...@@ -70,7 +71,7 @@ def test_create_poetry():
pathlib2 = dependencies["pathlib2"] pathlib2 = dependencies["pathlib2"]
assert pathlib2.pretty_constraint == "^2.2" assert pathlib2.pretty_constraint == "^2.2"
assert pathlib2.python_versions == "~2.7" assert parse_constraint(pathlib2.python_versions) == parse_constraint("~2.7")
assert not pathlib2.is_optional() assert not pathlib2.is_optional()
demo = dependencies["demo"] demo = dependencies["demo"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment