Skip to content

Commit bd8ed8d

Browse files
committed
adding coverage config
1 parent b834638 commit bd8ed8d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pyproject.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,17 @@ repository = "https://github.com/pylhc/turn_by_turn"
8585
documentation = "https://pylhc.github.io/turn_by_turn/"
8686
# changelog = "https://github.com/pylhc/turn_by_turn/blob/master/CHANGELOG.md"
8787

88-
# ----- Testing ----- #
88+
# ----- Tests Configuration ----- #
8989

9090
[tool.pytest.ini_options]
9191
addopts = [
9292
"--import-mode=importlib",
93+
"--cov-report=xml",
94+
"--cov-report term-missing",
95+
"--cov-config=pyproject.toml",
96+
"--cov=turn_by_turn",
9397
]
98+
testpaths = ["tests"]
9499
# Helpful for pytest-debugging (leave commented out on commit):
95100
# log_cli = true
96101
# log_cli_level = "DEBUG"
@@ -99,6 +104,12 @@ addopts = [
99104
[tool.coverage.run]
100105
relative_files = true
101106

107+
[tool.coverage.report]
108+
exclude_also = [
109+
"if TYPE_CHECKING:", # do not count type checking imports (ignored at runtime) for coverage
110+
"except ImportError:", # do not count missing optional dependencies set to None, we monkeypatch and test that
111+
]
112+
102113
# ----- Dev Tools Configuration ----- #
103114

104115
[tool.ruff]

0 commit comments

Comments
 (0)