Skip to content

Commit d9895f9

Browse files
authored
Merge pull request #8 from Zipstack/fix/sonar_coverage
Changed overage config to work with sonar cloud
2 parents 1dea56f + d88c50a commit d9895f9

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ line_length = 120
5353
[tool.pytest.ini_options]
5454
testpaths = ["tests"]
5555
python_files = ["test_*.py"]
56-
addopts = "--cov=helm_values_manager --cov-report=term-missing --cov-report=xml"
56+
python_classes = ["Test*"]
57+
python_functions = ["test_*"]
58+
addopts = "-v --cov=helm_values_manager --cov-report=term-missing --cov-report=xml --cov-branch"
5759

5860
[tool.coverage.run]
5961
source = ["helm_values_manager"]
@@ -64,12 +66,15 @@ branch = true
6466
exclude_lines = [
6567
"pragma: no cover",
6668
"def __repr__",
69+
"if self.debug:",
6770
"raise NotImplementedError",
6871
"if __name__ == .__main__.:",
6972
"pass",
7073
"raise ImportError",
7174
]
72-
show_missing = true
75+
76+
[tool.coverage.xml]
77+
output = "coverage.xml"
7378

7479
[tool.tox]
7580
legacy_tox_ini = """

tox.ini

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ isolated_build = True
55
[testenv]
66
extras = dev # Install development dependencies from pyproject.toml
77
deps =
8-
coverage
8+
pytest
9+
pytest-cov
910
allowlist_externals =
1011
curl
1112
bash
@@ -19,7 +20,4 @@ commands_pre =
1920
./get_helm.sh && \
2021
rm get_helm.sh; \
2122
fi'
22-
commands =
23-
# Run tests with coverage and generate both XML and JUnit reports
24-
coverage run -m pytest -rap --junitxml=junit.xml tests/
25-
coverage xml -i
23+
commands = pytest -v {posargs:tests/}

0 commit comments

Comments
 (0)