Skip to main content
Join the chat at https://gitter.im/prashanth-sams/pytest-html-reporter PyPI version https://coveralls.io/repos/github/prashanth-sams/pytest-html-reporter/badge.svg?branch=master Downloads

Generates a light-weight static html report based on pytest framework

pytest-html-reporter

Features

  • Generic information

    • Overview

    • Trends

    • Suite Highlights

    • Test suite details

  • Archives / History

  • Screenshots on failure

  • Test Rerun support

Installation

$ pip3 install pytest-html-reporter

Usage

By default, the filename used is pytest_html_reporter.html and path chosen is report; you can skip both or either one of them if not needed:

$ pytest tests/

Custom path, filename, and title

Add --html-report tag followed by path location and filename to customize the report location and filename:

$ pytest tests/ --html-report=./report
$ pytest tests/ --html-report=./report/report.html

Add --title tag followed by the report title:

$ pytest tests/ --html-report=./report --title='PYTEST REPORT'

Add --archive-count tag followed by an integer to limit showing the number of builds in the Archives section:

$ pytest tests/ --archive-count 7
$ pytest tests/ --html-report=./report --archive-count 7

pytest.ini

Alternate option is to add this snippet in the pytest.ini file:

[pytest]
addopts = -vs -rf --html-report=./report --title='PYTEST REPORT'

Note: If you fail to provide --html-report tag, it consider your project’s home directory as the base

screenshots on failure

Import attach from the library and call it with the selenium command as given below:

from pytest_html_reporter import attach

...
attach(data=self.driver.get_screenshot_as_png())
https://img.shields.io/badge/Attach_screenshot_snippet-000?style=for-the-badge&logo=ko-fi&logoColor=white https://i.imgur.com/1HSYkdC.gif

Is there a demo available for this gem?

Yes, you can use this demo as an example, https://github.com/prashanth-sams/pytest-html-reporter:

$ pytest tests/functional/

Download files

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

Source Distribution

pytest_html_reporter-0.3.1.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_html_reporter-0.3.1-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest_html_reporter-0.3.1.tar.gz.

File metadata

  • Download URL: pytest_html_reporter-0.3.1.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for pytest_html_reporter-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0181f9405c336ce3a1eaef9e36d30580108a94485c297825f932ee5648a2e5ac
MD5 4408a888853b9c39a81f8b1d0ce963cc
BLAKE2b-256 f2d81353fce5dcea322b3c60a35c453fe885eae191cc0e1edb29b245e4dcb191

See more details on using hashes here.

File details

Details for the file pytest_html_reporter-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_html_reporter-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a77a0064ea54aff309775f43dc50df6117a2d6325c058c79366703c1107483d7
MD5 ad78aa496186667579b5f72370e5b7ba
BLAKE2b-256 ef028c4fd9f7c8416bdc60a529f2240ba448b14391e5483a0f8c2f81c14a5e19

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

1 file

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.9

1 file

0.1.8

1 file

0.1.7

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page