I am using coverage.py to get line and branch coverage and it has been great. Now I heard of "Method Coverage" and I wonder if coverage.py (or py-cov) supports it. I have consulted https://coverage.readthedocs.io/, but there isn't mention to Method coverage, so maybe this is a no, but doesn't hurt to check with the experts.
The resulting XML would be as shown at https://github.com/danielpalme/ReportGenerator/blob/main/src/Testprojects/CSharp/Reports/Cobertura_coverlet.xml#L10
Maybe @dull timber knows a thing or two about this ๐
This is a snippet of the resulting XML. note the </methods> entry.
๏ปฟ<?xml version="1.0" encoding="utf-8"?>
<coverage line-rate="0.7069" branch-rate="0.75" version="1.9" timestamp="1696364443" lines-covered="152" lines-valid="215" branches-covered="9" branches-valid="12">
<sources>
<source>C:\temp\</source>
</sources>
<packages>
<package name="Test" line-rate="0.7069" branch-rate="0.75" complexity="60">
<classes>
<class name="Test.AbstractClass" filename="AbstractClass.cs" line-rate="1" branch-rate="1" complexity="1">
<methods>
<method name=".ctor" signature="()" line-rate="1" branch-rate="1" complexity="1">
<lines>
<line number="7" hits="4" branch="False" />
<line number="8" hits="4" branch="False" />
<line number="9" hits="4" branch="False" />
<line number="10" hits="4" branch="False" />
</lines>
</method>
</methods>
<lines>
<line number="7" hits="4" branch="False" />
<line number="8" hits="4" branch="False" />
<line number="9" hits="4" branch="False" />
<line number="10" hits="4" branch="False" />
</lines>
</class>
</packages>
</coverage>
Thanks