@pytest.mark.parametrize('console_scripts', ['test_ = distutils_install', 'test_:test_ = distutils_install'])
def test_uninstall_entry_point(script, console_scripts):
 pkg_name = 'ep_install'
 pkg_path = create_test_package_with_setup(script, name=pkg_name, version='0.1', entry_points={'console_scripts': [console_scripts], 'pip_test.ep': ['ep:name1 = distutils_install', 'ep:name2 = distutils_install']})
 script_name = script.bin_path.join(console_scripts.split('=')[0].strip())
 result = script.pip('install', pkg_path)
 assert script_name.exists
 result = script.pip('list', '--format=legacy')
 assert ('ep-install (0.1)' in result.stdout)
 script.pip('uninstall', 'ep_install', '-y')
 assert (not script_name.exists)
 result2 = script.pip('list', '--format=legacy')
 assert ('ep-install (0.1)' not in result2.stdout)

@ pytest . mark . parametrize ( 'console_scripts' , [ 'test_ = distutils_install' , 'test_:test_ = distutils_install' ] ) def test_uninstall_entry_point ( script , console_scripts ) : pkg_name = 'ep_install' pkg_path = create_test_package_with_setup ( script , name = pkg_name , version = '0.1' , entry_points = { 'console_scripts' : [ console_scripts ] , 'pip_test.ep' : [ 'ep:name1 = distutils_install' , 'ep:name2 = distutils_install' ] } ) script_name = script . bin_path . join ( console_scripts . split ( '=' ) [ 0 ] . strip ( ) ) result = script . pip ( 'install' , pkg_path ) assert script_name . exists result = script . pip ( 'list' , '--format=legacy' ) assert ( 'ep-install (0.1)' in result . stdout ) script . pip ( 'uninstall' , 'ep_install' , '-y' ) assert ( not script_name . exists ) result2 = script . pip ( 'list' , '--format=legacy' ) assert ( 'ep-install (0.1)' not in result2 . stdout )
test uninstall package with two or more entry points in the same section .