PyReport
Quick overview
PyReport is a lightweight reporting plugin for Pytest that provides concise HTML reports by parsing JunitXML test results
Pre-requisites
To be able to use this plugin you will need below dependencies that will be installed automatically with PyReport:
- Python >=3.7
- Jinja2
- Pytest
- matplotlib
- requests
- logstyle
Supported Messengers
- Telegram
- Slack
Getting started
Installation
To start using PyReport please follow below instructions:
- Install
pytest-pyreportplugin:
pip install pytest-pyreport==<version>
Report generation
- Run tests using below command to generate pyreport.html file with test results:
pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport
- Run tests using below command if you want to send Telegram notification
pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport --telegram-pyreport <chat id> <bot token>- Prerequisites:
- You need your own Telegram bot, which can be easily created using Telegram instructions. You can take the “chat ID” and “bot token” from there.
- Prerequisites:
- Run tests using below command if you want to send Slack notification
pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport --slack-pyreport <webhook url> <channel id> <bot token>- Prerequisites:
- You need your own Slack bot, which can be easily created using Slack instructions. You can take the “webhook url”, "channel id" and “bot token” from there.
- Prerequisites:
- Run tests using below command if you want to check generated report on the server if it is available:
pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport --telegram-pyreport <chat id> <bot token> --server <URL> pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport --slack-pyreport <webhook url> <channel id> <bot token> --server <URL>- Prerequisites:
- You need to run server beforehand. As an example using CI/CD tools like Jenkins or GitHub Actions
- Prerequisites:
- Run tests with failed tests counter. By running below command you will get JSON file with percentage of failed tests:
pytest --junitxml=result.xml -o junit_family="xunit1" --pyreport --failed-tests-count- Fail percentage formula:
Failed Tests Percentage = (Number of Failed Tests / Total Number of Tests) * 100 = (10 / 100) * 100 = 10%- Example
fail_percentage.json:
{"fail_count": 10, "fail_percentage": 10.0}
Test results
- Once test run completed you should see
pyreport.htmlfile that auto generated by using above commands.
Open it and check the test results as shown in below presentation
Presentation
Metadata
Release files for pytest-pyreport 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest_pyreport-1.6.0.tar.gz | 12.3 kB | Without provenance | Details for pytest_pyreport-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_pyreport-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for pytest_pyreport-1.6.0-py3-none-any.whl |
Total release size: 23.9 kB
Release files / pytest_pyreport-1.6.0.tar.gz
| Download URL | pytest_pyreport-1.6.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fed4bb9af9ea3838a9b83f549fddd740fd06f9822050d9739b05acc68289e615
|
|
BLAKE2b-256 checksum How to use checksums |
69b17a5072f06bf19cfdf98e58b3228630cdf8759baaacef710ac7e67eedbe57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Release files / pytest_pyreport-1.6.0-py3-none-any.whl
| Download URL | pytest_pyreport-1.6.0-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81cb2980e9ab7b7f8a18822282cb5f34e6b1f6e939cde459c6d07ea568c9e6db
|
|
BLAKE2b-256 checksum How to use checksums |
a7127c6659ef6586bf8abb14632fcd527cb854b4147d96f11bc1b8e3ad1df152
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Security for pytest-pyreport 1.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.