Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Coverage Analysis for Tests of Python Package #221 and Update Tox and Pytest Configurations #792

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added python/.coverage
Binary file not shown.
1 change: 1 addition & 0 deletions python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ venv/
dist/*
*.pickle
.s.yml
.DS_Store
6 changes: 6 additions & 0 deletions python/.tox/py310/.tox-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ToxEnv": {
"name": "py310",
"type": "VirtualEnvRunner"
}
}
6 changes: 6 additions & 0 deletions python/.tox/py37/.tox-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ToxEnv": {
"name": "py37",
"type": "VirtualEnvRunner"
}
}
6 changes: 6 additions & 0 deletions python/.tox/py38/.tox-info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ToxEnv": {
"name": "py38",
"type": "VirtualEnvRunner"
}
}
Binary file added python/da
Binary file not shown.
13 changes: 13 additions & 0 deletions python/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,17 @@ filterwarnings =
markers =
smoketest
slow
already # added new marker

[coverage:run]
source = python
omit =
*/tests/*
*/venv/*
*/__init__.py
[coverage:report]
# Setting the report format
show_missing= True # Show missing lines in the report
skip_covered = True # Skip files that are fully covered

pytest --cov=python tests/ --cov-report html
2 changes: 1 addition & 1 deletion python/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import string
from pathlib import Path
from typing import List


def get_tests_data_dir() -> Path:
repo_root_dir = Path(__file__).parent.parent
Expand Down
21 changes: 21 additions & 0 deletions python/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tox]
envlist = py311, coverage

[testenv]
basepython = python3.11
deps =
pytest
coverage
commands =
python -m coverage run -m pytest
python -m coverage report -m --skip-covered
python -m coverage html # Generate HTML coverage report

[testenv:coverage]
basepython = python3.11
deps = coverage
commands =
python -m coverage combine
python -m coverage report -m
python -m coverage html # Generate HTML report
python -m coverage json # Generate JSON