Fix LoadStreams final frame bug (#4387)

Co-authored-by: Nadim Bou Alwan <64587372+nadinator@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-08-16 19:00:03 +02:00 committed by GitHub
parent 17e6b9c270
commit fb1ae9bfad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 97 additions and 67 deletions

View file

@ -1,7 +1,14 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license
import shutil
from pathlib import Path
import pytest
from ultralytics.utils import ROOT
TMP = (ROOT / '../tests/tmp').resolve() # temp directory for test files
def pytest_addoption(parser):
parser.addoption('--runslow', action='store_true', default=False, help='run slow tests')
@ -19,3 +26,21 @@ def pytest_collection_modifyitems(config, items):
for item in items:
if 'slow' in item.keywords:
item.add_marker(skip_slow)
def pytest_sessionstart(session):
"""
Called after the 'Session' object has been created and before performing test collection.
"""
shutil.rmtree(TMP, ignore_errors=True) # delete any existing tests/tmp directory
TMP.mkdir(parents=True, exist_ok=True) # create a new empty directory
def pytest_terminal_summary(terminalreporter, exitstatus, config):
# Remove files
for file in ['bus.jpg', 'decelera_landscape_min.mov']:
Path(file).unlink(missing_ok=True)
# Remove directories
for directory in ['.pytest_cache/', TMP]:
shutil.rmtree(directory, ignore_errors=True)