Skip to main content

PyReport is a lightweight reporting plugin for Pytest that provides concise HTML report

Project description

PyReport

PyPI - Downloads

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 Telegram
  • Slack Slack

Getting started

Installation

To start using PyReport please follow below instructions:

  • Install pytest-pyreport plugin:
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 Telegram

    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.
  • Run tests using below command if you want to send Slack notification Slack

    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.
  • 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

Test results

  • Once test run completed you should see pyreport.html file that auto generated by using above commands.
    Open it and check the test results as shown in below presentation

Presentation

pyreport

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-pyreport-1.5.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

pytest_pyreport-1.5.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest-pyreport-1.5.0.tar.gz.

File metadata

  • Download URL: pytest-pyreport-1.5.0.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pytest-pyreport-1.5.0.tar.gz
Algorithm Hash digest
SHA256 abdf130c2e6070e7324289d36bb660ba60168d96204ed5a5175949a348503505
MD5 3b2cf59ebe3841b6b5e4c86a3bb5e406
BLAKE2b-256 538fbf150b5c11629672ed451be42f16fd3e73f36e45ce9bf07dc60e3988177a

See more details on using hashes here.

File details

Details for the file pytest_pyreport-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_pyreport-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b714760ef1b8cc3b6bea2139d86169d2071c14c1c77b77ad8d22ecc2923d92fd
MD5 b46e62203ba31cb49cf59a0a39d7ffe5
BLAKE2b-256 ec9fddc71448968e6909c753bdd9782e96df754878f1d5c2a2def75f19366217

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page