Metadata-Version: 2.1
Name: ward_coverage
Version: 0.3.1
Summary: A coverage plugin for Ward testing framework
Home-page: https://github.com/petereon/ward_coverage
License: MIT
Keywords: python
Author: Peter Vyboch
Author-email: pvyboch1@gmail.com
Requires-Python: >=3.7.8,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: coverage (>=5.0)
Requires-Dist: cucumber-tag-expressions (>3)
Requires-Dist: ward
Project-URL: Repository, https://github.com/petereon/ward_coverage
Description-Content-Type: text/markdown

# Ward Coverage

[![CI/CD](https://github.com/petereon/ward_coverage/actions/workflows/python-test.yml/badge.svg?branch=master)](https://github.com/petereon/ward_coverage/actions/workflows/python-test.yml) 
[![MyPy Lint](https://github.com/petereon/ward_coverage/actions/workflows/python-lint.yml/badge.svg?branch=master)](https://github.com/petereon/ward_coverage/actions/workflows/python-lint.yml) 
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=petereon_ward_coverage&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=petereon_ward_coverage)
![PyPI - Downloads](https://img.shields.io/pypi/dm/ward-coverage)

__Disclaimer: Albeit useful already, this is a work-in-progress and should be seen as such.__ 

A coverage plugin for Python's [Ward testing framework](https://ward.readthedocs.io/en/latest/)

![Example image](https://raw.githubusercontent.com/petereon/ward-coverage/master/resources/screen.png)

## Installation

Build the plugin:

```bash
poetry build
```
and install using

```bash
pip install dist/ward_coverage-0.1.1-py3-none-any.whl
```

## Configuration

To include coverage in your test run, add the following to your `pyproject.toml`:

```toml
[tool.ward]
hook_module = ["ward_coverage"]
```

There are several options to configure the plugin which can be included under section `[tool.ward.plugins.coverage]`, namely:
- `report_type`, defaulting to `["term"]`, which is a list of report types to generate. Possible values are one or more of _'lcov'_, _'html'_, _'xml'_, _'json'_, _'term'_
- `threshold` for minimum coverage, affecting the color the result panel has for some sort of visual cue
- All of the options described [here](https://coverage.readthedocs.io/en/6.4.4/config.html#run-source-pkgs). Please note that everything here under [`[run]` section](https://coverage.readthedocs.io/en/6.4.4/config.html#run) goes to  `[tool.ward.plugins.coverage]` and other sections need their separate block (e.g `[tool.ward.plugins.coverage.report]`) or dictionary entry within the `[tool.ward.plugins.coverage]` section in toml.

### Example configuration
```toml
[tool.ward.plugins.coverage]
omit = ["*test*", "example.py", "**/__init__.py"]
report_type = ["term", "xml"]
source = ["."]
branch = true
relative_files = true
report = {skip_empty = true}
```

__Contributors, issues and feature requests are welcome.__

