tests: Automatically create pytest marks for apps

Fixes: #2388.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-03-10 12:14:24 -07:00 committed by James Valleroy
parent 157abb023a
commit a3b6506a4e
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 9 additions and 54 deletions

View File

@ -23,6 +23,15 @@ def pytest_ignore_collect(path, config):
return not _functional_libs_available
def pytest_configure(config):
"""Register additional markers, one for each app."""
for app in (pathlib.Path(__file__).parent / 'modules').iterdir():
if not app.is_dir():
continue
config.addinivalue_line('markers', app.name)
def pytest_collection_modifyitems(config, items):
"""Filter out specificly marked tests unless explicitly requested.

View File

@ -136,62 +136,8 @@ markers = [
"skip",
"heavy",
"apps",
"avahi",
"backups",
"bepasty",
"bind",
"calibre",
"cockpit",
"config",
"coturn",
"datetime",
"deluge",
"domain",
"dynamicdns",
"ejabberd",
"email",
"gitweb",
"help",
"i2p",
"ikiwiki",
"infinoted",
"janus",
"jsxc",
"matrixsynapse",
"mediawiki",
"minetest",
"minidlna",
"mumble",
"openvpn",
"pagekite",
"performance",
"privacy",
"privoxy",
"quassel",
"radicale",
"roundcube",
"rssbridge",
"samba",
"searx",
"security",
"shaarli",
"shadowsocks",
"shadowsocksserver",
"sharing",
"snapshot",
"ssh",
"sso",
"storage",
"syncthing",
"system",
"tor",
"transmission",
"ttrss",
"upgrades",
"users",
"wireguard",
"wordpress",
"zoph",
]
# Useful when pylint is invoked separately instead of flake8