How to use the pycobertura.reporters.HtmlReporter function in pycobertura

To help you get started, we’ve selected a few pycobertura examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aconrad / pycobertura / tests / test_reporters.py View on Github external
def test_html_report__no_source_files_message():
    from pycobertura.reporters import HtmlReporter

    cobertura = make_cobertura()
    report = HtmlReporter(cobertura, title="test report", render_file_sources=False)
    html_output = report.generate()

    assert "normalize.css" in html_output
    assert "Skeleton V2.0" in html_output

    assert remove_style_tag(html_output) == """\
github aconrad / pycobertura / tests / test_reporters.py View on Github external
def test_html_report():
    from pycobertura.reporters import HtmlReporter

    cobertura = make_cobertura()
    report = HtmlReporter(cobertura)
    html_output = report.generate()

    assert "normalize.css" in html_output
    assert "Skeleton V2.0" in html_output

    assert remove_style_tag(html_output) == """\
github aconrad / pycobertura / pycobertura / cli.py View on Github external
import click

from pycobertura.cobertura import Cobertura
from pycobertura.reporters import (
    HtmlReporter,
    TextReporter,
    HtmlReporterDelta,
    TextReporterDelta,
)
from pycobertura.filesystem import filesystem_factory

pycobertura = click.Group()


reporters = {
    "html": HtmlReporter,
    "text": TextReporter,
}


class ExitCodes:
    OK = 0
    EXCEPTION = 1
    COVERAGE_WORSENED = 2
    NOT_ALL_CHANGES_COVERED = 3


def get_exit_code(differ, source):
    # Compute the non-zero exit code. This is a 2-step process which involves
    # checking whether code coverage is any better first and then check if all
    # changes are covered (stricter) which can only be done if the source code
    # is available (and enabled via the --source option).
github aconrad / pycobertura / pycobertura / reporters.py View on Github external
def __init__(self, *args, **kwargs):
        self.title = kwargs.pop("title", "pycobertura report")
        self.render_file_sources = kwargs.pop("render_file_sources", True)
        self.no_file_sources_message = kwargs.pop(
            "no_file_sources_message", "Rendering of source files was disabled."
        )
        super(HtmlReporter, self).__init__(*args, **kwargs)