pythoncov

package
v0.0.0-...-6061e1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package pythoncov reads coverage.py XML reports (the format produced by `coverage xml` and pytest-cov's --cov-report=xml). That XML follows the Cobertura schema, but unlike the cobertura loader this one matches purely on the repo-relative file path and ignores the absolute <source> root, so a typical pytest project run from the repo root works without pointing PARAMETER_SOURCE_DIRS at an absolute build path.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	XMLName xml.Name `xml:"class"`

	Filename string `xml:"filename,attr"`
	Lines    []Line `xml:"lines>line"`
}

type DefaultLoader

type DefaultLoader struct {
	// contains filtered or unexported fields
}

func NewReportLoader

func NewReportLoader() *DefaultLoader

func (*DefaultLoader) Load

func (l *DefaultLoader) Load(coverageFile string) (coverage.Report, error)

type Line

type Line struct {
	XMLName xml.Name `xml:"line"`

	Number int `xml:"number,attr"`
	Hits   int `xml:"hits,attr"`
}

type Package

type Package struct {
	XMLName xml.Name `xml:"package"`

	Classes []Class `xml:"classes>class"`
}

type Report

type Report struct {
	XMLName xml.Name `xml:"coverage"`

	Packages []Package `xml:"packages>package"`
}

func (*Report) GetCoverageData

func (r *Report) GetCoverageData(module string, sourceDir string, pkg string, fileName string, lineNumber int) (*domain.CoverageData, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL