debian-forge/test/conftest.py
Karolina Surma 7390f91592 Mark tests needing TOML-writing library with a custom marker
This way they can be conveniently skipped with `pytest -m "not
tomlwrite"` in environments where such libraries aren't available.
2025-06-23 19:51:29 +02:00

22 lines
756 B
Python

unsupported_filesystems = []
"""Globally accessible list of filesystems that are unsupported on the system when running test cases"""
def pytest_addoption(parser):
parser.addoption(
"--unsupported-fs",
action="append",
default=[],
metavar="FS",
help="List of filesystems to treat as unsupported on the system when running test cases." +
"Can be specified multiple times.",
)
def pytest_configure(config):
# pylint: disable=global-statement
global unsupported_filesystems
unsupported_filesystems = config.getoption("--unsupported-fs")
config.addinivalue_line(
"markers", "tomlwrite: mark test to run only in an environment with a TOML-writing library available"
)