diff --git a/tests/functional/test_invalid_versions_and_specifiers.py b/tests/functional/test_invalid_versions_and_specifiers.py index f48b92be71e..21ce02085fc 100644 --- a/tests/functional/test_invalid_versions_and_specifiers.py +++ b/tests/functional/test_invalid_versions_and_specifiers.py @@ -2,6 +2,7 @@ import pytest +from pip._internal.metadata import select_backend from tests.lib import PipTestEnvironment, TestData @@ -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"