Skip to content

Commit

Permalink
Add support for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
moi15moi committed Jan 27, 2025
1 parent 547e736 commit 9c518bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ jobs:
pip install 'numpy<2'
pip install pywin32
}
python -m unittest discover -v -s ./comtypes/test -t comtypes\test
pip install coverage[toml]
coverage run -m unittest discover -v -s comtypes\test -t comtypes\test
- name: Run coverage report
run: coverage report
- name: Unregister the OutProc COM server
run: |
cd source/CppTestSrv
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ ignore = ["E402"]
"comtypes/test/test_typeinfo.py" = ["F401"]
"comtypes/test/test_urlhistory.py" = ["E401", "F401", "F403", "F405", "F841"]
"comtypes/test/test_variant.py" = ["F401", "F821", "F841"]

[tool.coverage.run]
# Specify the source directory to avoid tracking temporary files created by "test_client_regenerate_modules.py".
# Without this, coverage track these temporary files, leading to error when trying to generate a report.
source = ["comtypes"]
omit = ["comtypes/gen/*"]

0 comments on commit 9c518bc

Please sign in to comment.