Skip to content

Commit 056f6f9

Browse files
committed
fix: ignore flaky OSError on windows
Problem: ``` > os.unlink(fname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpugb75_rw' ```
1 parent 6ab90aa commit 056f6f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_vim.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
import os
32
import tempfile
43
from typing import Any
@@ -31,7 +30,10 @@ def test_command(vim: Nvim) -> None:
3130
assert os.path.isfile(fname)
3231
with open(fname) as f:
3332
assert f.read() == 'testing\npython\napi\n'
34-
os.unlink(fname)
33+
try:
34+
os.unlink(fname)
35+
except OSError:
36+
pass # on windows, this can be flaky; ignore it
3537

3638

3739
def test_command_output(vim: Nvim) -> None:

0 commit comments

Comments
 (0)