

def test_existing_over_wheel_priority(self, data):
    '\n        Test existing install has priority over wheels.\n        `test_link_sorting` also covers this at a lower level\n        '
    req = InstallRequirement.from_line('priority', None)
    latest_version = '1.0'
    satisfied_by = Mock(location='/path', parsed_version=parse_version(latest_version), version=latest_version)
    req.satisfied_by = satisfied_by
    finder = PackageFinder([data.find_links], [], session=PipSession())
    with pytest.raises(BestVersionAlreadyInstalled):
        finder.find_requirement(req, True)

dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py TestWheel.test_existing_over_wheel_priority/original