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

(cherry picked from commit 1ec8be3)
  • Loading branch information
radoering authored and github-actions[bot] committed Oct 30, 2022
1 parent 507f506 commit 42da05a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions tests/inspection/test_info.py
Original file line number Diff line number Diff line change
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 42da05a

Please sign in to comment.