@@ -129,7 +129,11 @@ def in_tmpdir(paths: List[str]) -> List[str]:
129
129
130
130
class TestUninstallPathSet :
131
131
def test_add (self , tmpdir : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
132
- monkeypatch .setattr (pip ._internal .req .req_uninstall .UninstallPathSet , "_permitted" , mock_permitted )
132
+ monkeypatch .setattr (
133
+ pip ._internal .req .req_uninstall .UninstallPathSet ,
134
+ "_permitted" ,
135
+ mock_permitted ,
136
+ )
133
137
# Fix case for windows tests
134
138
file_extant = os .path .normcase (os .path .join (tmpdir , "foo" ))
135
139
file_nonexistent = os .path .normcase (os .path .join (tmpdir , "nonexistent" ))
@@ -145,7 +149,11 @@ def test_add(self, tmpdir: Path, monkeypatch: pytest.MonkeyPatch) -> None:
145
149
assert ups ._paths == {file_extant }
146
150
147
151
def test_add_pth (self , tmp_path : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
148
- monkeypatch .setattr (pip ._internal .req .req_uninstall .UninstallPathSet , "_permitted" , mock_permitted )
152
+ monkeypatch .setattr (
153
+ pip ._internal .req .req_uninstall .UninstallPathSet ,
154
+ "_permitted" ,
155
+ mock_permitted ,
156
+ )
149
157
# Fix case for windows tests
150
158
tmpdir = os .path .normcase (tmp_path )
151
159
on_windows = sys .platform == "win32"
@@ -175,7 +183,11 @@ def test_add_pth(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
175
183
176
184
@pytest .mark .skipif ("sys.platform == 'win32'" )
177
185
def test_add_symlink (self , tmpdir : Path , monkeypatch : pytest .MonkeyPatch ) -> None :
178
- monkeypatch .setattr (pip ._internal .req .req_uninstall .UninstallPathSet , "_permitted" , mock_permitted )
186
+ monkeypatch .setattr (
187
+ pip ._internal .req .req_uninstall .UninstallPathSet ,
188
+ "_permitted" ,
189
+ mock_permitted ,
190
+ )
179
191
f = os .path .join (tmpdir , "foo" )
180
192
with open (f , "w" ):
181
193
pass
@@ -187,7 +199,11 @@ def test_add_symlink(self, tmpdir: Path, monkeypatch: pytest.MonkeyPatch) -> Non
187
199
assert ups ._paths == {foo_link }
188
200
189
201
def test_compact_shorter_path (self , monkeypatch : pytest .MonkeyPatch ) -> None :
190
- monkeypatch .setattr (pip ._internal .req .req_uninstall .UninstallPathSet , "_permitted" , mock_permitted )
202
+ monkeypatch .setattr (
203
+ pip ._internal .req .req_uninstall .UninstallPathSet ,
204
+ "_permitted" ,
205
+ mock_permitted ,
206
+ )
191
207
monkeypatch .setattr ("os.path.exists" , lambda p : True )
192
208
# This deals with nt/posix path differences
193
209
short_path = os .path .normcase (
@@ -202,7 +218,11 @@ def test_compact_shorter_path(self, monkeypatch: pytest.MonkeyPatch) -> None:
202
218
def test_detect_symlink_dirs (
203
219
self , monkeypatch : pytest .MonkeyPatch , tmpdir : Path
204
220
) -> None :
205
- monkeypatch .setattr (pip ._internal .req .req_uninstall .UninstallPathSet , "_permitted" , mock_permitted )
221
+ monkeypatch .setattr (
222
+ pip ._internal .req .req_uninstall .UninstallPathSet ,
223
+ "_permitted" ,
224
+ mock_permitted ,
225
+ )
206
226
207
227
# construct 2 paths:
208
228
# tmpdir/dir/file
0 commit comments