pytest: add custom marker in pyproject.toml instead of conftest.py

This commit is contained in:
bronsen 2026-05-21 23:22:26 +02:00
parent 22fc814327
commit 14e5c6b68c
2 changed files with 8 additions and 12 deletions

View file

@ -68,7 +68,14 @@ source_dirs = ["src/"]
# custom marks are created in conftest.py # custom marks are created in conftest.py
[tool.pytest] [tool.pytest]
python_files = ["*_test.py", "test_*.py", "tests.py"] markers = ["final"]
python_files = ["test_*.py", "tests.py"]
required_plugins = [
"pytest-asyncio",
"pytest-cov",
"pytest-randomly",
"pytest-textual-snapshot",
]
strict_config = true strict_config = true
strict_markers = true strict_markers = true
strict_parametrization_ids = false strict_parametrization_ids = false

View file

@ -1,11 +0,0 @@
from pytest import Config
def pytest_configure(config: Config):
"""
Registers a new mark 'final' that can be applied to tests.
I did not want to add these in pyproject.toml.
"""
config.addinivalue_line("markers", "final: the final test")