88
99import sys
1010
11- from iptest import is_ironpython , generate_suite , run_test , is_posix
11+ from iptest import is_ironpython , generate_suite , run_test , is_posix , is_windows
1212
1313import test .test_os
1414
15+ def is_exfat ():
16+ import clr
17+ clr .AddReference ("System.IO.FileSystem.DriveInfo" )
18+ import os
19+ import System .IO
20+ try :
21+ drive = os .path .splitdrive (os .getcwd ())[0 ]
22+ format = System .IO .DriveInfo (drive ).DriveFormat .lower ()
23+ return format == "exfat"
24+ except :
25+ return False
26+
1527def load_tests (loader , standard_tests , pattern ):
1628 tests = loader .loadTestsFromModule (test .test_os , pattern = pattern )
1729
@@ -31,10 +43,6 @@ def load_tests(loader, standard_tests, pattern):
3143 test .test_os .FileTests ('test_symlink_keywords' ), # IndexError: Index was outside the bounds of the array.
3244 test .test_os .OSErrorTests ('test_oserror_filename' ), # AssertionError: '@test_732_tmp' is not b'@test_732_tmp'
3345 test .test_os .StatAttributeTests ('test_stat_result_pickle' ), # AssertionError
34- test .test_os .UtimeTests ('test_utime' ), # OSError: [WinError 87] The parameter is incorrect.
35- test .test_os .UtimeTests ('test_utime_by_indexed' ), # OSError: [WinError 87] The parameter is incorrect.
36- test .test_os .UtimeTests ('test_utime_by_times' ), # OSError: [WinError 87] The parameter is incorrect.
37- test .test_os .UtimeTests ('test_utime_directory' ), # OSError: [WinError 87] The parameter is incorrect.
3846 test .test_os .Win32KillTests ('test_kill_int' ), # AssertionError
3947 test .test_os .Win32KillTests ('test_kill_sigterm' ), # AssertionError
4048 ]
@@ -44,11 +52,6 @@ def load_tests(loader, standard_tests, pattern):
4452 test .test_os .FDInheritanceTests ('test_get_inheritable_cloexec' ), # AttributeError: 'module' object has no attribute 'get_inheritable'
4553 test .test_os .FDInheritanceTests ('test_set_inheritable_cloexec' ), # AssertionError
4654 ]
47- else :
48- failing_tests += [
49- test .test_os .UtimeTests ('test_utime_current' ), # AssertionError
50- test .test_os .UtimeTests ('test_utime_current_old' ), # AssertionError
51- ]
5255 if sys .version_info < (3 , 6 ):
5356 failing_tests += [
5457 test .test_os .Win32DeprecatedBytesAPI ('test_deprecated' ), # AttributeError: 'module' object has no attribute '_isdir'
@@ -75,12 +78,19 @@ def load_tests(loader, standard_tests, pattern):
7578 test .test_os .TestScandir ('test_removed_file' ), # FileNotFoundError
7679 ]
7780
78- skip_tests = [
79- # these require symlink support on drive
80- test .test_os .LinkTests ('test_link' ),
81- test .test_os .LinkTests ('test_link_bytes' ),
82- test .test_os .LinkTests ('test_unicode_name' ),
83- ]
81+ skip_tests = []
82+ if is_windows and is_exfat ():
83+ skip_tests += [
84+ test .test_os .LinkTests ('test_link' ),
85+ test .test_os .LinkTests ('test_link_bytes' ),
86+ test .test_os .LinkTests ('test_unicode_name' ),
87+ test .test_os .UtimeTests ('test_utime' ),
88+ test .test_os .UtimeTests ('test_utime_by_indexed' ),
89+ test .test_os .UtimeTests ('test_utime_by_times' ),
90+ test .test_os .UtimeTests ('test_utime_directory' ),
91+ test .test_os .UtimeTests ('test_utime_current' ),
92+ test .test_os .UtimeTests ('test_utime_current_old' ),
93+ ]
8494 if sys .version_info >= (3 , 6 ):
8595 skip_tests += [
8696 # SpawnTests seem to create a console
0 commit comments