Skip to content

Commit acd7ef1

Browse files
committed
Perform relaxed version matching in pip debug test
This ensures that we're not trying to compare versions as equal strings.
1 parent 17b7345 commit acd7ef1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/functional/test_debug.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import re
12
from typing import List
23

34
import pytest
5+
from pip._vendor.packaging.version import Version
46

57
from pip._internal.commands.debug import create_vendor_txt_map
68
from pip._internal.utils import compatibility_tags
@@ -45,7 +47,9 @@ def test_debug__library_versions(script: PipTestEnvironment) -> None:
4547

4648
vendored_versions = create_vendor_txt_map()
4749
for name, value in vendored_versions.items():
48-
assert f"{name}=={value}" in result.stdout
50+
match = re.search(rf"{name}==(\S+)", result.stdout)
51+
assert match is not None, f"Could not find {name} in output"
52+
assert Version(match.group(1)) == Version(value)
4953

5054

5155
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)