Abandon with Retry(): context manager (#13159)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-05-28 03:10:17 +02:00 committed by GitHub
parent 22de23ec8d
commit 25c9f77c8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 27 deletions

View file

@ -15,7 +15,6 @@ from ultralytics.utils import (
LINUX,
MACOS,
WINDOWS,
Retry,
checks,
)
from ultralytics.utils.torch_utils import TORCH_1_9, TORCH_1_13
@ -69,8 +68,7 @@ def test_export_openvino_matrix(task, dynamic, int8, half, batch):
file = Path(file)
file = file.rename(file.with_stem(f"{file.stem}-{uuid.uuid4()}"))
YOLO(file)([SOURCE] * batch, imgsz=64 if dynamic else 32) # exported model inference
with Retry(times=3, delay=1): # retry in case of potential lingering multi-threaded file usage errors
shutil.rmtree(file)
shutil.rmtree(file, ignore_errors=True) # retry in case of potential lingering multi-threaded file usage errors
@pytest.mark.slow