Skip to content

Commit

Permalink
Fix test_show_require_invalid_version with pkg_resources backend
Browse files Browse the repository at this point in the history
The pkg_ressources metadata backend does not suffer from invalid metadata in this test case.
  • Loading branch information
sbidoul committed May 2, 2024
1 parent 012d679 commit dc2b212
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/functional/test_invalid_versions_and_specifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from pip._internal.metadata import select_backend
from tests.lib import PipTestEnvironment, TestData


Expand Down Expand Up @@ -130,4 +131,9 @@ def test_show_require_invalid_version(
result = script.pip("show", "require-invalid-version")
assert "Name: require-invalid-version\nVersion: 1.0\n" in result.stdout
assert "Requires: invalid-version ==2010i\n" in result.stdout
assert "Required-by: #N/A\n" in result.stdout
if select_backend().NAME == "importlib":
assert "Required-by: #N/A\n" in result.stdout
elif select_backend().NAME == "pkg_resources":
assert "Required-by: \n" in result.stdout
else:
assert False, "Unknown metadata backend"

0 comments on commit dc2b212

Please sign in to comment.