def test_list_json(script, data):
 script.pip('install', '-f', data.find_links, '--no-index', 'simple==1.0', 'simple2==3.0')
 result = script.pip('list', '--format=json')
 data = json.loads(result.stdout)
 assert ({'name': 'simple', 'version': '1.0'} in data)
 assert ({'name': 'simple2', 'version': '3.0'} in data)

def test_list_json ( script , data ) : script . pip ( 'install' , '-f' , data . find_links , '--no-index' , 'simple==1.0' , 'simple2==3.0' ) result = script . pip ( 'list' , '--format=json' ) data = json . loads ( result . stdout ) assert ( { 'name' : 'simple' , 'version' : '1.0' } in data ) assert ( { 'name' : 'simple2' , 'version' : '3.0' } in data )
test json formatting of list command .