def test_command_line_options_override_env_vars(script, virtualenv):
 script.environ['PIP_INDEX_URL'] = 'https://b.pypi.python.org/simple/'
 result = script.pip('install', '-vvv', 'INITools', expect_error=True)
 assert ('Getting page https://b.pypi.python.org/simple/initools' in result.stdout)
 virtualenv.clear()
 result = script.pip('install', '-vvv', '--index-url', 'https://download.zope.org/ppix', 'INITools', expect_error=True)
 assert ('b.pypi.python.org' not in result.stdout)
 assert ('Getting page https://download.zope.org/ppix' in result.stdout)

def test_command_line_options_override_env_vars ( script , virtualenv ) : script . environ [ 'PIP_INDEX_URL' ] = 'https://b.pypi.python.org/simple/' result = script . pip ( 'install' , '-vvv' , 'INITools' , expect_error = True ) assert ( 'Getting page https://b.pypi.python.org/simple/initools' in result . stdout ) virtualenv . clear ( ) result = script . pip ( 'install' , '-vvv' , '--index-url' , 'https://download.zope.org/ppix' , 'INITools' , expect_error = True ) assert ( 'b.pypi.python.org' not in result . stdout ) assert ( 'Getting page https://download.zope.org/ppix' in result . stdout )
test that command line options override environmental variables .