def test_uninstall_rollback(script, data):
 result = script.pip('install', '-f', data.find_links, '--no-index', 'broken==0.1')
 assert ((script.site_packages / 'broken.py') in result.files_created), list(result.files_created.keys())
 result2 = script.pip('install', '-f', data.find_links, '--no-index', 'broken===0.2broken', expect_error=True)
 assert (result2.returncode == 1), str(result2)
 assert (script.run('python', '-c', 'import broken; print(broken.VERSION)').stdout == '0.1\n')
 assert_all_changes(result.files_after, result2, [(script.venv / 'build')])

def test_uninstall_rollback ( script , data ) : result = script . pip ( 'install' , '-f' , data . find_links , '--no-index' , 'broken==0.1' ) assert ( ( script . site_packages / 'broken.py' ) in result . files_created ) , list ( result . files_created . keys ( ) ) result2 = script . pip ( 'install' , '-f' , data . find_links , '--no-index' , 'broken===0.2broken' , expect_error = True ) assert ( result2 . returncode == 1 ) , str ( result2 ) assert ( script . run ( 'python' , '-c' , 'import broken; print(broken.VERSION)' ) . stdout == '0.1\n' ) assert_all_changes ( result . files_after , result2 , [ ( script . venv / 'build' ) ] )
test uninstall-rollback .