12
12
13
13
@pytest .mark .incompatible_with_test_venv
14
14
class Tests_UninstallUserSite :
15
-
16
15
@pytest .mark .network
17
16
def test_uninstall_from_usersite (self , script ):
18
17
"""
19
18
Test uninstall from usersite
20
19
"""
21
- result1 = script .pip (' install' , ' --user' , ' INITools==0.3' )
22
- result2 = script .pip (' uninstall' , '-y' , ' INITools' )
23
- assert_all_changes (result1 , result2 , [script .venv / ' build' , ' cache' ])
20
+ result1 = script .pip (" install" , " --user" , " INITools==0.3" )
21
+ result2 = script .pip (" uninstall" , "-y" , " INITools" )
22
+ assert_all_changes (result1 , result2 , [script .venv / " build" , " cache" ])
24
23
25
- def test_uninstall_from_usersite_with_dist_in_global_site (
26
- self , virtualenv , script ):
24
+ def test_uninstall_from_usersite_with_dist_in_global_site (self , virtualenv , script ):
27
25
"""
28
26
Test uninstall from usersite (with same dist in global site)
29
27
"""
30
28
_patch_dist_in_site_packages (virtualenv )
31
29
32
- script .pip_install_local (' pip-test-package==0.1' , ' --no-binary=:all:' )
30
+ script .pip_install_local (" pip-test-package==0.1" , " --no-binary=:all:" )
33
31
34
32
result2 = script .pip_install_local (
35
- '--user' , 'pip-test-package==0.1.1' , '--no-binary=:all:' )
36
- result3 = script .pip ('uninstall' , '-vy' , 'pip-test-package' )
33
+ "--user" , "pip-test-package==0.1.1" , "--no-binary=:all:"
34
+ )
35
+ result3 = script .pip ("uninstall" , "-vy" , "pip-test-package" )
37
36
38
37
# uninstall console is mentioning user scripts, but not global scripts
39
38
assert normcase (script .user_bin_path ) in result3 .stdout , str (result3 )
40
39
assert normcase (script .bin_path ) not in result3 .stdout , str (result3 )
41
40
42
41
# uninstall worked
43
- assert_all_changes (result2 , result3 , [script .venv / ' build' , ' cache' ])
42
+ assert_all_changes (result2 , result3 , [script .venv / " build" , " cache" ])
44
43
45
44
# site still has 0.2 (can't look in result1; have to check)
46
45
# keep checking for egg-info because no-binary implies setup.py install
47
46
egg_info_folder = (
48
- script .base_path / script .site_packages /
49
- f'pip_test_package-0.1-py{ pyversion } .egg-info'
47
+ script .base_path
48
+ / script .site_packages
49
+ / f"pip_test_package-0.1-py{ pyversion } .egg-info"
50
50
)
51
51
assert isdir (egg_info_folder )
52
52
@@ -58,22 +58,20 @@ def test_uninstall_editable_from_usersite(self, script, data):
58
58
59
59
# install
60
60
to_install = data .packages .joinpath ("FSPkg" )
61
- result1 = script .pip (
62
- 'install' , '--user' , '-e' , to_install
63
- )
64
- egg_link = script .user_site / 'FSPkg.egg-link'
61
+ result1 = script .pip ("install" , "--user" , "-e" , to_install )
62
+ egg_link = script .user_site / "FSPkg.egg-link"
65
63
result1 .did_create (egg_link )
66
64
67
65
# uninstall
68
- result2 = script .pip (' uninstall' , '-y' , ' FSPkg' )
66
+ result2 = script .pip (" uninstall" , "-y" , " FSPkg" )
69
67
assert not isfile (script .base_path / egg_link )
70
68
71
69
assert_all_changes (
72
70
result1 ,
73
71
result2 ,
74
72
[
75
- script .venv / ' build' ,
76
- ' cache' ,
77
- script .user_site / ' easy-install.pth' ,
78
- ]
73
+ script .venv / " build" ,
74
+ " cache" ,
75
+ script .user_site / " easy-install.pth" ,
76
+ ],
79
77
)
0 commit comments