From ca362f80fe740464e7db9c4a39b270ab29c5a4a9 Mon Sep 17 00:00:00 2001 From: "itdrui.de" Date: Sun, 1 Feb 2026 23:32:30 +0100 Subject: [PATCH] Integrate pytest coverage configuration --- README.md | 5 +++++ pyproject.toml | 20 ++++++++++++++++++++ requirements-dev.txt | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 pyproject.toml create mode 100644 requirements-dev.txt diff --git a/README.md b/README.md index 3f651be..831ee23 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,10 @@ ViewIT ist ein Kodi‑Addon zum Durchsuchen und Abspielen von Inhalten der unter - Plugins: `addon/plugins/*_plugin.py` - Einstellungen: `addon/resources/settings.xml` +## Tests mit Abdeckung +- Dev-Abhängigkeiten installieren: `./.venv/bin/pip install -r requirements-dev.txt` +- Tests + Coverage starten: `./.venv/bin/pytest` +- Optional (XML-Report): `./.venv/bin/pytest --cov-report=xml` + ## Dokumentation Siehe `docs/`. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..884d2d4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[tool.pytest.ini_options] +addopts = "-q --cov=addon --cov-report=term-missing" +python_files = ["test_*.py"] +norecursedirs = ["scripts"] +markers = [ + "live: real HTTP requests (set LIVE_TESTS=1 to run)", + "perf: performance benchmarks", +] + +[tool.coverage.run] +source = ["addon"] +branch = true +omit = [ + "*/__pycache__/*", + "addon/resources/*", +] + +[tool.coverage.report] +show_missing = true +skip_empty = true diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..f03cefd --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +pytest>=9,<10 +pytest-cov>=5,<8