def test_existing_over_wheel_priority(self, data):
        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)
Test existing install has priority over wheels.
dataset/ETHPy150Open pypa/pip/tests/unit/test_finder.py/TestWheel.test_existing_over_wheel_priority