Skip to content

Commit 0a6d856

Browse files
authored
Do not compare build metadata if null (#2501)
1 parent 0053ea0 commit 0a6d856

File tree

1 file changed

+7
-3
lines changed
  • test-integration/test_integration

1 file changed

+7
-3
lines changed

test-integration/test_integration/util.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,13 @@ def assert_versions_match(semver_version: str, pep440_version: str):
9393
if semver_pre.startswith("dev"):
9494
assert pep440_groups["dev_l"] == "dev", "Dev build status does not match"
9595

96-
assert pep440_groups["local"].startswith(semver_groups["buildmetadata"]), (
97-
f"Local/build metadata component does not match: {semver_groups['buildmetadata']} != {pep440_groups['local']}"
98-
)
96+
if (
97+
pep440_groups["local"] is not None
98+
and semver_groups["buildmetadata"] is not None
99+
):
100+
assert pep440_groups["local"].startswith(semver_groups["buildmetadata"]), (
101+
f"Local/build metadata component does not match: {semver_groups['buildmetadata']} != {pep440_groups['local']}"
102+
)
99103

100104

101105
def random_string(length):

0 commit comments

Comments
 (0)