Make deleting test dir suring shell integration tests robust against fish 4 background daemon generating completions
This commit is contained in:
parent
54e1f639a8
commit
8cbdd003e2
1 changed files with 10 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
# License: GPLv3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
|
||||
import errno
|
||||
import os
|
||||
import shlex
|
||||
import shutil
|
||||
|
|
@ -101,8 +102,15 @@ def run_shell(self, shell='zsh', rc='', cmd='', setup_env=None):
|
|||
i -= 1
|
||||
yield pty
|
||||
finally:
|
||||
if os.path.exists(home_dir):
|
||||
shutil.rmtree(home_dir)
|
||||
while os.path.exists(home_dir):
|
||||
try:
|
||||
shutil.rmtree(home_dir)
|
||||
except OSError as e:
|
||||
# As of fish 4 fish runs a background daemon generating
|
||||
# completions.
|
||||
if e.errno == errno.ENOTEMPTY:
|
||||
continue
|
||||
raise
|
||||
|
||||
@unittest.skipUnless(shutil.which('zsh'), 'zsh not installed')
|
||||
def test_zsh_integration(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue