From a3b6506a4e04cfbc62d7054429bb71488500f514 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 10 Mar 2024 12:14:24 -0700 Subject: [PATCH] tests: Automatically create pytest marks for apps Fixes: #2388. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/conftest.py | 9 ++++++++ pyproject.toml | 54 ---------------------------------------------- 2 files changed, 9 insertions(+), 54 deletions(-) diff --git a/plinth/conftest.py b/plinth/conftest.py index 8df2a4f8d..9236f7fa6 100644 --- a/plinth/conftest.py +++ b/plinth/conftest.py @@ -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. diff --git a/pyproject.toml b/pyproject.toml index 2a035450f..0cfa98b4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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