

def test_freeze_with_requirement_option(script):
    '\n    Test that new requirements are created correctly with --requirement hints\n\n    '
    ignores = textwrap.dedent('        # Unchanged requirements below this line\n        -r ignore.txt\n        --requirement ignore.txt\n        -Z ignore\n        --always-unzip ignore\n        -f http://ignore\n        -i http://ignore\n        --pre\n        --trusted-host url\n        --process-dependency-links\n        --extra-index-url http://ignore\n        --find-links http://ignore\n        --index-url http://ignore\n        ')
    script.scratch_path.join('hint.txt').write((textwrap.dedent("        INITools==0.1\n        NoExist==4.2\n        simple==3.0; python_version > '1.0'\n        ") + ignores))
    result = script.pip_install_local('initools==0.2')
    result = script.pip_install_local('simple')
    result = script.pip('freeze', '--requirement', 'hint.txt', expect_stderr=True)
    expected = (('INITools==0.2\nsimple==3.0\n' + ignores) + '## The following requirements were added by pip freeze:...')
    _check_output(result.stdout, expected)
    assert ('Requirement file contains NoExist==4.2, but that package is not installed' in result.stderr)

dataset/ETHPy150Open pypa/pip/tests/functional/test_freeze.py test_freeze_with_requirement_option/original