debian-forge/test/conftest.py
Tomáš Hozza ff6b96bee5 Test: add ability to skip tests for unsupported file-systems
Add a new optional pytest CLI argument `--unsupported-fs` allowing to
specify file-systems which should be treated as unsupported in the
platform where running tests. Any test cases dependent on such
file-system support will be sipped.

This will allow to run unit tests and selectively skipping test cases
for unsupported file-systems.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-04-21 17:13:10 +02:00

19 lines
611 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")