

@pytest.mark.network
def test_finder_detects_latest_already_satisfied_pypi_links():
    'Test PackageFinder detects latest already satisfied using pypi links'
    req = InstallRequirement.from_line('initools', None)
    latest_version = '0.3.1'
    satisfied_by = Mock(location='/path', parsed_version=parse_version(latest_version), version=latest_version)
    req.satisfied_by = satisfied_by
    finder = PackageFinder([], ['http://pypi.python.org/simple'], session=PipSession())
    with pytest.raises(BestVersionAlreadyInstalled):
        finder.find_requirement(req, True)

dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py test_finder_detects_latest_already_satisfied_pypi_links/original