Skip to content

Commit 83f9c41

Browse files
committed
add test coverage report
1 parent 1afd6f1 commit 83f9c41

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ dev = [
4141
"flake8>=7.0.0",
4242
"pytest>=7.4.0",
4343
"pytest-asyncio>=0.21.0",
44+
"pytest-cov>=4.1.0",
4445
]
4546

4647
[project.scripts]
@@ -49,3 +50,16 @@ opencage = "opencage.command_line:main"
4950
[project.urls]
5051
Repository = "https://github.com/OpenCageData/python-opencage-geocoder"
5152
Download = "https://github.com/OpenCageData/python-opencage-geocoder/tarball/3.2.0"
53+
54+
[tool.coverage.run]
55+
branch = true
56+
source = ["opencage"]
57+
58+
[tool.coverage.report]
59+
show_missing = true
60+
exclude_lines = [
61+
"pragma: no cover",
62+
"def __repr__",
63+
"raise NotImplementedError",
64+
"if __name__ == .__main__.:",
65+
]

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ python =
1414
deps =
1515
responses
1616
pytest
17+
pytest-cov
1718
pytest-aiohttp
1819
pytest-asyncio
1920
commands =
20-
pytest test
21+
pytest --cov=opencage --cov-report=term-missing test
2122

2223
[testenv:lint]
2324
usedevelop = True

0 commit comments

Comments
 (0)