Skip to content

Support branch coverage - #40

Open
lackhove wants to merge 4 commits into
mainfrom
feature/branch-cov
Open

lackhove wants to merge 4 commits into
mainfrom
feature/branch-cov

Conversation

@lackhove

@lackhove lackhove commented Mar 15, 2026

Copy link
Copy Markdown
Owner

fixes #5

@lackhove lackhove changed the title Feature/branch cov Support branch coverage Mar 15, 2026
@lackhove
lackhove force-pushed the feature/branch-cov branch from a65ab1d to 9315b33 Compare March 15, 2026 22:38
@lackhove
lackhove force-pushed the feature/branch-cov branch from e4b2ad4 to bf45806 Compare March 31, 2026 20:12
@lackhove
lackhove marked this pull request as ready for review March 31, 2026 20:12
@lackhove
lackhove force-pushed the feature/branch-cov branch from bf45806 to 7c4febb Compare April 5, 2026 09:19
@lackhove

lackhove commented Apr 5, 2026

Copy link
Copy Markdown
Owner Author

@cdleonard This feature should be working now. The shell-based project I used for testing is finished and I no longer have access to it. Could you maybe take this for a spin and see if anything breaks or seems off?

@cdleonard

Copy link
Copy Markdown
Contributor

Used this in a few private projects and it seems fine.

I did however find a new unrelated issue: #48

@cdleonard

cdleonard commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I did eventually find a failure specific to branch coverage (doesn't fail otherwise):

#! /bin/bash

fun()
{
    if [[ -z $myvar ]]; then
        echo "Missing myvar?" >&2
        exit 1
    fi
}

myvar=1 fun

Relevant part of log:

INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/pytest_cov/plugin.py", line 362, in pytest_runtestloop
INTERNALERROR>     self.cov_total = self.cov_controller.summary(self.cov_report)
INTERNALERROR>                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/pytest_cov/engine.py", line 189, in summary
INTERNALERROR>     self.cov.html_report(ignore_errors=True, directory=output)
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/coverage/control.py", line 1259, in html_report
INTERNALERROR>     return reporter.report(morfs)
INTERNALERROR>            ~~~~~~~~~~~~~~~^^^^^^^
INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/coverage/html.py", line 392, in report
INTERNALERROR>     self.write_html_page(ftr)
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~^^^^^
INTERNALERROR>   File "/home/leonard/Projects/test-python-coverage-sh/sample/.venv/lib/python3.13/site-packages/coverage/html.py", line 527, in write_html_page
INTERNALERROR>     assert len(longs) == 1, (
INTERNALERROR>            ^^^^^^^^^^^^^^^
INTERNALERROR> AssertionError: Had long annotations in fail_jump_in_func.sh: ["Line 5 didn't jump to line 6", "Line 5 didn't jump to line 7"]

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

Successfully merging this pull request may close these issues.

Support for branch coverage

2 participants