@pytest.mark.network
def test_finder_priority_page_over_deplink():
 req = InstallRequirement.from_line('pip==1.5.6', None)
 finder = PackageFinder([], ['https://pypi.python.org/simple'], process_dependency_links=True, session=PipSession())
 finder.add_dependency_links(['https://warehouse.python.org/packages/source/p/pip/pip-1.5.6.tar.gz'])
 all_versions = finder.find_all_candidates(req.name)
 assert all_versions[(-1)].location.url.startswith('https://warehouse')
 link = finder.find_requirement(req, False)
 assert link.url.startswith('https://pypi'), link

@ pytest . mark . network def test_finder_priority_page_over_deplink ( ) : req = InstallRequirement . from_line ( 'pip==1.5.6' , None ) finder = PackageFinder ( [ ] , [ 'https://pypi.python.org/simple' ] , process_dependency_links = True , session = PipSession ( ) ) finder . add_dependency_links ( [ 'https://warehouse.python.org/packages/source/p/pip/pip-1.5.6.tar.gz' ] ) all_versions = finder . find_all_candidates ( req . name ) assert all_versions [ ( - 1 ) ] . location . url . startswith ( 'https://warehouse' ) link = finder . find_requirement ( req , False ) assert link . url . startswith ( 'https://pypi' ) , link
test packagefinder prefers page links over equivalent dependency links .