@@ -258,6 +258,11 @@ def test_unpack_file_url_thats_a_dir(self, tmpdir, data):
258
258
259
259
260
260
class TestSafeFileCache :
261
+ """
262
+ The no_perms test are useless on Windows since SafeFileCache uses
263
+ pip.utils.filesystem.check_path_owner which is based on os.geteuid
264
+ which is absent on Windows.
265
+ """
261
266
262
267
def test_cache_roundtrip (self , tmpdir ):
263
268
cache_dir = tmpdir .join ("test-cache" )
@@ -270,6 +275,7 @@ def test_cache_roundtrip(self, tmpdir):
270
275
cache .delete ("test key" )
271
276
assert cache .get ("test key" ) is None
272
277
278
+ @pytest .mark .skipif ("sys.platform == 'win32'" )
273
279
def test_safe_get_no_perms (self , tmpdir , monkeypatch ):
274
280
cache_dir = tmpdir .join ("unreadable-cache" )
275
281
cache_dir .makedirs ()
@@ -280,14 +286,16 @@ def test_safe_get_no_perms(self, tmpdir, monkeypatch):
280
286
cache = SafeFileCache (cache_dir )
281
287
cache .get ("foo" )
282
288
289
+ @pytest .mark .skipif ("sys.platform == 'win32'" )
283
290
def test_safe_set_no_perms (self , tmpdir ):
284
291
cache_dir = tmpdir .join ("unreadable-cache" )
285
292
cache_dir .makedirs ()
286
293
os .chmod (cache_dir , 000 )
287
294
288
295
cache = SafeFileCache (cache_dir )
289
- cache .set ("foo" , "bar" )
296
+ cache .set ("foo" , b "bar" )
290
297
298
+ @pytest .mark .skipif ("sys.platform == 'win32'" )
291
299
def test_safe_delete_no_perms (self , tmpdir ):
292
300
cache_dir = tmpdir .join ("unreadable-cache" )
293
301
cache_dir .makedirs ()
0 commit comments