

def test_finder_priority_file_over_page(data):
    'Test PackageFinder prefers file links over equivalent page links'
    req = InstallRequirement.from_line('gmpy==1.15', None)
    finder = PackageFinder([data.find_links], ['http://pypi.python.org/simple'], session=PipSession())
    all_versions = finder.find_all_candidates(req.name)
    assert (link[0].location.scheme == 'file')
    assert all(((version.location.scheme == 'https') for version in all_versions[1:])), all_versions
    link = finder.find_requirement(req, False)
    assert link.url.startswith('file://')

dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py test_finder_priority_file_over_page/VarMisuse@57/112 `all_versions`->`link`