Skip to content

Commit

Permalink
fix: ignore flaky OSError on windows
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
wookayin committed Oct 15, 2023
1 parent 6ab90aa commit 056f6f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_vim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
import os
import tempfile
from typing import Any
Expand Down Expand Up @@ -31,7 +30,10 @@ def test_command(vim: Nvim) -> None:
assert os.path.isfile(fname)
with open(fname) as f:
assert f.read() == 'testing\npython\napi\n'
os.unlink(fname)
try:
os.unlink(fname)
except OSError:
pass # on windows, this can be flaky; ignore it


def test_command_output(vim: Nvim) -> None:
Expand Down

0 comments on commit 056f6f9

Please sign in to comment.