@@ -375,19 +375,20 @@ def open_dir(path):
375375 assert dir_is_tagged (path = str (normal_dir ), exclude_caches = False ) == []
376376
377377 # Test 2: exclude_caches with file-descriptor-based operations
378- with open_dir (str (cache_dir )) as fd :
379- assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == [CACHE_TAG_NAME ]
380- with open_dir (str (invalid_cache_dir )) as fd :
381- assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == []
382- with open_dir (str (normal_dir )) as fd :
383- assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == []
384-
385- with open_dir (str (cache_dir )) as fd :
386- assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
387- with open_dir (str (invalid_cache_dir )) as fd :
388- assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
389- with open_dir (str (normal_dir )) as fd :
390- assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
378+ if not is_win32 :
379+ with open_dir (str (cache_dir )) as fd :
380+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == [CACHE_TAG_NAME ]
381+ with open_dir (str (invalid_cache_dir )) as fd :
382+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == []
383+ with open_dir (str (normal_dir )) as fd :
384+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True ) == []
385+
386+ with open_dir (str (cache_dir )) as fd :
387+ assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
388+ with open_dir (str (invalid_cache_dir )) as fd :
389+ assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
390+ with open_dir (str (normal_dir )) as fd :
391+ assert dir_is_tagged (dir_fd = fd , exclude_caches = False ) == []
391392
392393 # Test 3: exclude_if_present with path-based operations
393394 tags = [".NOBACKUP" ]
@@ -401,21 +402,22 @@ def open_dir(path):
401402 assert dir_is_tagged (path = str (normal_dir ), exclude_if_present = tags ) == []
402403
403404 # Test 4: exclude_if_present with file descriptor-based operations
404- tags = [".NOBACKUP" ]
405- with open_dir (str (tagged_dir )) as fd :
406- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".NOBACKUP" ]
407- with open_dir (str (other_tagged_dir )) as fd :
408- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
409- with open_dir (str (normal_dir )) as fd :
410- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
411-
412- tags = [".NOBACKUP" , ".DONOTBACKUP" ]
413- with open_dir (str (tagged_dir )) as fd :
414- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".NOBACKUP" ]
415- with open_dir (str (other_tagged_dir )) as fd :
416- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".DONOTBACKUP" ]
417- with open_dir (str (normal_dir )) as fd :
418- assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
405+ if not is_win32 :
406+ tags = [".NOBACKUP" ]
407+ with open_dir (str (tagged_dir )) as fd :
408+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".NOBACKUP" ]
409+ with open_dir (str (other_tagged_dir )) as fd :
410+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
411+ with open_dir (str (normal_dir )) as fd :
412+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
413+
414+ tags = [".NOBACKUP" , ".DONOTBACKUP" ]
415+ with open_dir (str (tagged_dir )) as fd :
416+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".NOBACKUP" ]
417+ with open_dir (str (other_tagged_dir )) as fd :
418+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == [".DONOTBACKUP" ]
419+ with open_dir (str (normal_dir )) as fd :
420+ assert dir_is_tagged (dir_fd = fd , exclude_if_present = tags ) == []
419421
420422 # Test 5: both exclude types with path-based operations
421423 assert sorted (dir_is_tagged (path = str (both_dir ), exclude_caches = True , exclude_if_present = [".NOBACKUP" ])) == [
@@ -427,14 +429,15 @@ def open_dir(path):
427429 assert dir_is_tagged (path = str (normal_dir ), exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == []
428430
429431 # Test 6: both exclude types with file descriptor-based operations
430- with open_dir (str (both_dir )) as fd :
431- assert sorted (dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ])) == [
432- ".NOBACKUP" ,
433- CACHE_TAG_NAME ,
434- ]
435- with open_dir (str (cache_dir )) as fd :
436- assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == [CACHE_TAG_NAME ]
437- with open_dir (str (tagged_dir )) as fd :
438- assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == [".NOBACKUP" ]
439- with open_dir (str (normal_dir )) as fd :
440- assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == []
432+ if not is_win32 :
433+ with open_dir (str (both_dir )) as fd :
434+ assert sorted (dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ])) == [
435+ ".NOBACKUP" ,
436+ CACHE_TAG_NAME ,
437+ ]
438+ with open_dir (str (cache_dir )) as fd :
439+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == [CACHE_TAG_NAME ]
440+ with open_dir (str (tagged_dir )) as fd :
441+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == [".NOBACKUP" ]
442+ with open_dir (str (normal_dir )) as fd :
443+ assert dir_is_tagged (dir_fd = fd , exclude_caches = True , exclude_if_present = [".NOBACKUP" ]) == []
0 commit comments