Skip to content

Commit

Permalink
Update print-coverage.py
Browse files Browse the repository at this point in the history
  • Loading branch information
frack113 committed Nov 11, 2024
1 parent bcecabb commit 942a5db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions {{ cookiecutter.package_name }}/print-coverage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Prints code testing coverage as percentage for badge generation.
import xml.etree.ElementTree as et
from defusedxml.ElementTree import parse

tree = et.parse("cov.xml")
tree = parse("cov.xml")
root = tree.getroot()
coverage = float(root.attrib["line-rate"]) * 100
print(f"COVERAGE={coverage:3.4}%")
Expand Down
1 change: 1 addition & 0 deletions {{ cookiecutter.package_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ packages = [
python = "^3.9"

[tool.poetry.dev-dependencies]
defusedxml = "^0.7"

[build-system]
requires = ["poetry-core>=1.8.1"]
Expand Down

0 comments on commit 942a5db

Please sign in to comment.