Skip to content

Commit

Permalink
tests: make tests forward compatible (space before semicolon in PEP 5…
Browse files Browse the repository at this point in the history
…08 requirements) (#6914)

required for python-poetry/poetry-core#510
  • Loading branch information
radoering committed Oct 30, 2022
1 parent 2a70d67 commit 1ec8be3
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions tests/inspection/test_info.py
Expand Up @@ -101,12 +101,23 @@ def demo_check_info(info: PackageInfo, requires_dist: set[str] = None) -> None:
assert info.version == "0.1.0"
assert info.requires_dist

requires_dist = requires_dist or {
'cleo; extra == "foo"',
"pendulum (>=1.4.4)",
'tomlkit; extra == "bar"',
}
assert set(info.requires_dist) == requires_dist
if requires_dist:
assert set(info.requires_dist) == requires_dist
else:
assert set(info.requires_dist) in (
# before https://github.com/python-poetry/poetry-core/pull/510
{
'cleo; extra == "foo"',
"pendulum (>=1.4.4)",
'tomlkit; extra == "bar"',
},
# after https://github.com/python-poetry/poetry-core/pull/510
{
'cleo ; extra == "foo"',
"pendulum (>=1.4.4)",
'tomlkit ; extra == "bar"',
},
)


def test_info_from_sdist(demo_sdist: Path):
Expand Down

0 comments on commit 1ec8be3

Please sign in to comment.