

def test_install_requirements_with_options(self, tmpdir, finder, session, options):
    global_option = '--dry-run'
    install_option = '--prefix=/opt'
    content = '\n        --only-binary :all:\n        INITools==2.0 --global-option="{global_option}"                         --install-option "{install_option}"\n        '.format(global_option=global_option, install_option=install_option)
    with requirements_file(content, tmpdir) as reqs_file:
        req = next(parse_requirements(reqs_file.abspath, finder=finder, options=options, session=session))
    req.source_dir = os.curdir
    with patch.object(subprocess, 'Popen') as popen:
        popen.return_value.stdout.readline.return_value = ''
        try:
            req.install([])
        except:
            pass
        call = popen.call_args_list[0][0][0]
        assert (call.index(install_option) > call.index('install') > call.index(global_option) > 0)
    assert (options.format_control.no_binary == set([':all:']))
    assert (options.format_control.only_binary == set([]))

dataset/ETHPy150Open pypa/pip/tests/unit/test_req_file.py TestParseRequirements.test_install_requirements_with_options/original