mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-22 21:04:21 +08:00
Update pyproject.toml [tool.pytest.ini_options]
(#9259)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
33607ca278
commit
8d31c50856
@ -140,9 +140,13 @@ package-data = { "ultralytics" = ["**/*.yaml"], "ultralytics.assets" = ["*.jpg"]
|
||||
[tool.setuptools.dynamic]
|
||||
version = { attr = "ultralytics.__version__" }
|
||||
|
||||
[tool.pytest]
|
||||
norecursedirs = [".git", "dist", "build"]
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--doctest-modules --durations=30 --color=yes"
|
||||
markers = [
|
||||
"slow: skip slow tests unless --slow is set",
|
||||
]
|
||||
norecursedirs = [".git", "dist", "build"]
|
||||
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["ultralytics/"]
|
||||
|
@ -3,8 +3,6 @@
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
TMP = Path(__file__).resolve().parent / "tmp" # temp directory for test files
|
||||
|
||||
|
||||
@ -18,27 +16,6 @@ def pytest_addoption(parser):
|
||||
parser.addoption("--slow", action="store_true", default=False, help="Run slow tests")
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
"""
|
||||
Register custom markers to avoid pytest warnings.
|
||||
|
||||
Args:
|
||||
config (pytest.config.Config): The pytest config object.
|
||||
"""
|
||||
config.addinivalue_line("markers", "slow: mark test as slow to run")
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
"""
|
||||
Setup hook to skip tests marked as slow if the --slow option is not provided.
|
||||
|
||||
Args:
|
||||
item (pytest.Item): The test item object.
|
||||
"""
|
||||
if "slow" in item.keywords and not item.config.getoption("--slow"):
|
||||
pytest.skip("skip slow tests unless --slow is set")
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
"""
|
||||
Modify the list of test items to remove tests marked as slow if the --slow option is not provided.
|
||||
|
Loading…
x
Reference in New Issue
Block a user