Skip to content

Commit 8c408eb

Browse files
committed
chore(tests): use coverage directly
1 parent 74f29fb commit 8c408eb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ tracker = "https://github.com/compilerla/conventional-pre-commit/issues"
2020
dev = [
2121
"black",
2222
"build",
23+
"coverage",
2324
"flake8",
2425
"pre-commit",
2526
"pytest",
26-
"pytest-cov"
2727
]
2828

2929
[project.scripts]
@@ -38,6 +38,11 @@ line-length = 127
3838
target-version = ['py311']
3939
include = '\.pyi?$'
4040

41+
[tool.coverage.run]
42+
branch = true
43+
relative_files = true
44+
source = ["conventional_pre_commit"]
45+
4146
[tool.pytest.ini_options]
4247
testpaths = ["tests"]
4348
norecursedirs = [

tests/run.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
21
#!/usr/bin/env bash
32
set -eux
43

5-
pytest --cov=conventional_pre_commit --cov-branch --import-mode=importlib
4+
# run normal pytests
5+
coverage run -m pytest
66

77
# clean out old coverage results
8-
rm -rf coverage
9-
coverage html --directory coverage
8+
rm -rf ./tests/coverage
9+
10+
# regenerate coverate report
11+
coverage html --directory ./tests/coverage

0 commit comments

Comments
 (0)