Skip to content

Commit aa5064e

Browse files
committed
Set up code coverage testing during CI
1 parent 05f9822 commit aa5064e

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

.coveragerc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[run]
2+
omit =
3+
setup.py
4+
5+
[report]
6+
exclude_lines =
7+
@abstract
8+
if TYPE_CHECKING:
9+
if __name__ == .__main__.:
10+
pragma: no cover
11+
raise AssertionError
12+
raise NotImplementedError

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
__pycache__
33
ENV/
44
.DS_Store
5-
UpCloud.egg-info/
6-
*.pyc
5+
*.py[cod]
76
build/
87
dist/
98
*.egg-info
@@ -13,6 +12,10 @@ docs/html/
1312
.cache
1413
.vscode/
1514

15+
# coverage
16+
.coverage
17+
htmlcov
18+
1619
# pyenv
1720
.python-version
1821

requirements-dev.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ isort
1111
mock
1212
pip-tools
1313
pytest
14+
pytest-cov
1415
responses
1516
safety

requirements-dev.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ click==7.1.2
2525
# black
2626
# pip-tools
2727
# safety
28+
coverage==5.5
29+
# via pytest-cov
2830
dparse==0.5.1
2931
# via safety
3032
flake8-bandit==2.1.2
@@ -99,8 +101,12 @@ pyflakes==2.2.0
99101
# via flake8
100102
pyparsing==2.4.7
101103
# via packaging
102-
pytest==6.2.3
104+
pytest-cov==2.11.1
103105
# via -r requirements-dev.in
106+
pytest==6.2.3
107+
# via
108+
# -r requirements-dev.in
109+
# pytest-cov
104110
pyyaml==5.4.1
105111
# via
106112
# bandit

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ envlist = py36, py37, py38, py39, pypy3
88
skip_missing_interpreters = True
99

1010
[testenv]
11-
commands = py.test test/
11+
commands = py.test --cov=test --cov={envsitepackagesdir}/upcloud_api --cov-report term-missing test/
1212
deps = -rrequirements-dev.txt
1313

1414
[testenv:integration]

0 commit comments

Comments
 (0)