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]
|
[tool.setuptools.dynamic]
|
||||||
version = { attr = "ultralytics.__version__" }
|
version = { attr = "ultralytics.__version__" }
|
||||||
|
|
||||||
[tool.pytest]
|
[tool.pytest.ini_options]
|
||||||
norecursedirs = [".git", "dist", "build"]
|
|
||||||
addopts = "--doctest-modules --durations=30 --color=yes"
|
addopts = "--doctest-modules --durations=30 --color=yes"
|
||||||
|
markers = [
|
||||||
|
"slow: skip slow tests unless --slow is set",
|
||||||
|
]
|
||||||
|
norecursedirs = [".git", "dist", "build"]
|
||||||
|
|
||||||
|
|
||||||
[tool.coverage.run]
|
[tool.coverage.run]
|
||||||
source = ["ultralytics/"]
|
source = ["ultralytics/"]
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
TMP = Path(__file__).resolve().parent / "tmp" # temp directory for test files
|
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")
|
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):
|
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.
|
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