A basic HTML report for pytest using Jinja2 template engine.
Project description
This is a fork of the great template pytest-reporter-html1 with one detail changed: Instead of grouping the tests and showing only a number how many tests have failed and how many have passed, this template tries to mimic the standard pytest output with one dot for every test. This has the advantages that (1) even without expanding a file it’s visible which tests have failed and whether they are the same like in the last run and (2) it gives a better visualization how many tests have failed in a specific file.
A basic HTML report for pytest using Jinja2 template engine. Based on pytest-reporter which provides the data to the template.
Features
Overview of files, tests, and phases with expandable sections
Includes information about tests such as documentation, markers, and fixtures
Fairly mobile friendly
Complies with Jenkins default CSP policy (with --split-report)
Support for pytest-metadata and pytest-rerunfailures
May be used as a base template for customization
Installation
You can install “pytest-reporter-html-dots” via pip from PyPI:
$ pip install pytest-reporter-html-dots
Usage
Specify the html-dots template and the output path of the report:
$ pytest --template=html-dots/index.html --report=report.html
By default the report is self-contained, but you can separate CSS, images, and JavaScript by specifying the --split-report option.
Customization
You can inherit this template in your own to tailor parts of it to your own needs. It defines various blocks which you can override using template inheritance.
{% extends "html-dots/index.html" %}
{% block style %}
{{ super() }}
header {
background-color: black;
}
{% endblock %}
Some additional filters are available for templates to use:
- asset(path_or_content, extension)
Takes a path to a local file or a raw bytes object and either returns a base64 encoded URL or a new relative URL to a copy depending on if the report is self-contained or not.
<img src=
"{{ 'path/to/image.png'|asset }}"> <img src="{{ raw_byte_data|asset('png') }}">- ansi(s)
Convert ANSI color codes to HTML.
- strftime(value, format)
Format a Unix timestamp using datetime.strftime.
Started: {{ started|strftime('%Y-%m-%d %H:%M:%S') }}
- timedelta(value)
Convert a time in seconds to a timedelta object.
- rst(s)
Convert reStructuredText to HTML.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest-reporter-html-dots-0.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec6d45a607e1a75ad34adfdc3542fbec5af54ed0f5408815bf827592324f3316 |
|
MD5 | d59c2fad29cfd4d08b9388e21c04965a |
|
BLAKE2b-256 | 634a848be2ac2ce831d78d0f17654fe898055be5e2a105b27871e153cedcacac |
Hashes for pytest_reporter_html_dots-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a31df4f67e440a73aea632491c2db5530e8d904b5cdeafe89e84b85eb4d0972 |
|
MD5 | 31ac21278f06acfe18bf4057215446d6 |
|
BLAKE2b-256 | ce60a0e05acb5aba15bb1ffc79b9633896983fe06454af33e737a5f9e1b3dd7f |