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

Generates a 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.0.tar.gz (29.0 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.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_html_reporter-0.3.0.tar.gz
  • Upload date:
  • Size: 29.0 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.0.tar.gz
Algorithm Hash digest
SHA256 8d7c6de3aa7724f314449e066b8e1afeea37a7c64abd9c6c537fb3b2eb86232e
MD5 751bed19b757b391120426adce36c923
BLAKE2b-256 053a45393eeeb529c3dd05e26ea8428d66297a4faea6b535efd97388a8843fa8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_html_reporter-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 890c8d648ffa760eeec97537b322fb033fae3c4b4a129ddf465344a28516caeb
MD5 9d869314f750fce86b93e829407f7a02
BLAKE2b-256 01d4ceac372ee1597be5641472f29733e9986fabb3ff4697d4b0271c31b641a5

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

0.3.1

2 files

This release

0.3.0 This release

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