Skip to content

Commit e5ede8c

Browse files
committed
tests: use pytest-cov for test coverage summaries
1 parent 7d6913e commit e5ede8c

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ def test(session):
4242
session.install("-e", ".[testing]")
4343

4444
# Run github activity and re-use the posargs
45-
cmd = ["pytest", "--verbose", "--durations=10"] + session.posargs
45+
cmd = ["pytest"] + session.posargs
4646
session.run(*cmd)

pyproject.toml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Source = "https://github.com/executablebooks/github-activity"
2424
[project.optional-dependencies]
2525
testing = [
2626
"pytest",
27+
"pytest-cov",
2728
"pytest-regressions",
2829
]
2930
sphinx = [
@@ -54,6 +55,24 @@ dependencies = { file = "requirements.txt" }
5455
# only the file-finder
5556
fallback_version = "0.0.0"
5657

58+
59+
[tool.ruff.lint.per-file-ignores]
60+
"docs/conf.py" = ["E402"]
61+
62+
63+
# pytest is used for running Python based tests
64+
#
65+
# ref: https://docs.pytest.org/en/stable/
66+
#
67+
[tool.pytest.ini_options]
68+
addopts = "--verbose --color=yes --durations=10 --cov=github_activity"
69+
testpaths = ["tests"]
70+
71+
72+
[tool.coverage.run]
73+
patch = ["subprocess"]
74+
75+
5776
[tool.tbump]
5877
github_url = "https://github.com/executablebooks/github-activity"
5978

@@ -82,6 +101,3 @@ search = 'version = "{current_version}"'
82101
[[tool.tbump.file]]
83102
src = "github_activity/__init__.py"
84103
search = '__version__ = "{current_version}"'
85-
86-
[tool.ruff.lint.per-file-ignores]
87-
"docs/conf.py" = ["E402"]

0 commit comments

Comments
 (0)