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

Is there a way to enable branch coverage? #116

Open
snackattas opened this issue Mar 17, 2024 · 1 comment
Open

Is there a way to enable branch coverage? #116

snackattas opened this issue Mar 17, 2024 · 1 comment

Comments

@snackattas
Copy link

At least with the python coverage.py, there's an option to enable branch coverage:

This adds attributes like this to the xml, see branches-valid, branches-covered, branch-rate, etc

<?xml version="1.0" ?>
<coverage version="7.4.3" timestamp="1709319429613" lines-valid="883" lines-covered="538" line-rate="0.6093" branches-valid="133" branches-covered="48" branch-rate="0.3609" complexity="0">
	<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.4.3 -->
	<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
	<sources>
		<source>/Users/zattas/fakerepo</source>
	</sources>
	<packages>
		<package name="src" line-rate="0.7214" branch-rate="0.6522" complexity="0">
			<classes>
				<class name="__init__.py" filename="src/__init__.py" complexity="0" line-rate="1" branch-rate="1">
					<methods/>
					<lines/>
				</class>
				<class name="api.py" filename="src/api.py" complexity="0" line-rate="0.7214" branch-rate="0.6522">
					<methods/>
					<lines>
						<line number="1" hits="1"/>
						<line number="2" hits="1"/>
@afinetooth
Copy link

In case it helps as reference material, I left a comment about how branch coverage is represented in Coveralls JSON-format coverage upload files here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants