diff --git a/pyproject.toml b/pyproject.toml index 93476ac..51b14a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,9 @@ line_length = 120 [tool.pytest.ini_options] testpaths = ["tests"] python_files = ["test_*.py"] -addopts = "--cov=helm_values_manager --cov-report=term-missing --cov-report=xml" +python_classes = ["Test*"] +python_functions = ["test_*"] +addopts = "-v --cov=helm_values_manager --cov-report=term-missing --cov-report=xml --cov-branch" [tool.coverage.run] source = ["helm_values_manager"] @@ -64,12 +66,15 @@ branch = true exclude_lines = [ "pragma: no cover", "def __repr__", + "if self.debug:", "raise NotImplementedError", "if __name__ == .__main__.:", "pass", "raise ImportError", ] -show_missing = true + +[tool.coverage.xml] +output = "coverage.xml" [tool.tox] legacy_tox_ini = """ diff --git a/tox.ini b/tox.ini index 1a1d830..bdfb4ac 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,8 @@ isolated_build = True [testenv] extras = dev # Install development dependencies from pyproject.toml deps = - coverage + pytest + pytest-cov allowlist_externals = curl bash @@ -19,7 +20,4 @@ commands_pre = ./get_helm.sh && \ rm get_helm.sh; \ fi' -commands = - # Run tests with coverage and generate both XML and JUnit reports - coverage run -m pytest -rap --junitxml=junit.xml tests/ - coverage xml -i +commands = pytest -v {posargs:tests/}