def test_user_flag(script, data, virtualenv):
 virtualenv.system_site_packages = True
 script.pip('install', '-f', data.find_links, '--no-index', 'simple==1.0')
 script.pip('install', '-f', data.find_links, '--no-index', '--user', 'simple2==2.0')
 result = script.pip('list', '--user', '--format=legacy')
 assert ('simple (1.0)' not in result.stdout)
 assert ('simple2 (2.0)' in result.stdout)

def test_user_flag ( script , data , virtualenv ) : virtualenv . system_site_packages = True script . pip ( 'install' , '-f' , data . find_links , '--no-index' , 'simple==1.0' ) script . pip ( 'install' , '-f' , data . find_links , '--no-index' , '--user' , 'simple2==2.0' ) result = script . pip ( 'list' , '--user' , '--format=legacy' ) assert ( 'simple (1.0)' not in result . stdout ) assert ( 'simple2 (2.0)' in result . stdout )
test the behavior of --user flag in the list command .