File tree Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Expand file tree Collapse file tree 1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -3087,7 +3087,7 @@ def test_stat_unlink_race(self):
3087
3087
3088
3088
@support .requires_subprocess ()
3089
3089
def test_stat_inaccessible_file (self ):
3090
- filename = os . path . abspath ( "test_stat_inaccessible_file.txt" )
3090
+ filename = os_helper . TESTFN
3091
3091
ICACLS = os .path .expandvars (r"%SystemRoot%\System32\icacls.exe" )
3092
3092
3093
3093
with open (filename , "wb" ) as f :
@@ -3109,22 +3109,6 @@ def test_stat_inaccessible_file(self):
3109
3109
pass
3110
3110
self .skipTest ("Unable to create inaccessible file" )
3111
3111
3112
- # We should now not be able to open the file. If we can, the test isn't
3113
- # going to work. A few retries to try and catch slow updates
3114
- try :
3115
- for _ in range (5 ):
3116
- with open (filename , "rb" ) as f :
3117
- pass
3118
- time .sleep (0.5 )
3119
- except PermissionError :
3120
- pass
3121
- else :
3122
- try :
3123
- os .unlink (filename )
3124
- except Exception :
3125
- pass
3126
- self .skipTest ("Still had access to inaccessible file" )
3127
-
3128
3112
def cleanup ():
3129
3113
# Give delete permission. We are the file owner, so we can do this
3130
3114
# even though we removed all permissions earlier.
You can’t perform that action at this time.
0 commit comments