Skip to main content

HTMLTestRunner-rv for professional unit test reporting

Project description

HTMLTestRunner-rv

PyPI version License: MIT Python Versions

HTMLTestRunner-rv is a professional, feature-rich HTML test report generator for the Python unittest framework. It provides a modern dashboard-style interface with detailed metrics, per-test timing, and interactive filtering to make debugging seamless.

Check the Live Documentation


🌟 Key Features

  • 📊 Modern Dashboard: A card-based overview of Pass, Fail, Error, and Skip rates.
  • 🕒 Per-Test Duration: Tracks the exact execution time for every test case.
  • 🔍 Interactive Filtering: Toggle views for Summary, Failed, Passed, or Errored tests with one click.
  • 🖥️ Dark Terminal Theme: Execution logs (stdout/stderr) are displayed in a professional dark terminal window.
  • 🚀 Instant Feedback: Optionally opens the generated report in your default browser automatically.
  • 📁 Smart Logging: Captures all print statements and errors into timestamped .txt files.
  • ✅ Full unittest Support: Supports subTest, skip, and all standard unittest features.

🛠️ Installation

Install the latest version of HTMLTestRunner-rv using pip:

pip install HTMLTestRunner-rv

🚀 Quick Start

Creating a professional test report is as simple as replacing your standard unittest.TextTestRunner with HTMLTestRunner.

Simple Example

import unittest
from HTMLTestRunner.runner import HTMLTestRunner

class MyTests(unittest.TestCase):
    def test_success(self):
        """A simple successful test"""
        print("Executing success test...")
        self.assertEqual(1, 1)

    def test_error(self):
        """A test that raises an error"""
        print("Executing error test...")
        return 1 / 0

if __name__ == '__main__':
    # Load your tests
    suite = unittest.TestLoader().loadTestsFromTestCase(MyTests)
    
    # Initialize the runner
    runner = HTMLTestRunner(
        title='Test Report Review',
        description='Daily regression test results',
        tested_by='Your Name',
        open_in_browser=True
    )
    
    # Run the tests
    runner.run(suite)

⚙️ Configuration Parameters

Parameter Type Default Description
output str 'reports' Directory where the HTML report and logs will be saved.
report_name str 'report' The prefix for the generated report file name.
title str 'Test Report Review' The title displayed at the top of the HTML report.
description str None A brief description of the test suite.
verbosity int 1 Controls the console output detail level.
log bool False If True, captures all print statements to a timestamped .txt file.
open_in_browser bool False Automatically opens the report in your web browser after completion.
add_traceback bool True Includes full error tracebacks in the report.
tested_by str 'Unknown' Name of the person or system that ran the tests.
style str "" Custom CSS string to inject into the report.
script str "" Custom JavaScript string to inject into the report.

📝 License

Distributed under the MIT License. See LICENSE.txt for more information.


🤝 Sponsorship & Funding

This project is proudly funded and supported by RV Anveshana. Their commitment to open-source innovation helps maintain and evolve this framework for the developer community.


💰 Support the Project

If you find this tool useful, please consider supporting its development. Your contribution helps us maintain and improve this framework.

👉 Click here for donation


Developed by Ravikirana B - ravikiranb36@gmail.com

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

htmltestrunner_rv-1.1.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

htmltestrunner_rv-1.1.4-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file htmltestrunner_rv-1.1.4.tar.gz.

File metadata

  • Download URL: htmltestrunner_rv-1.1.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for htmltestrunner_rv-1.1.4.tar.gz
Algorithm Hash digest
SHA256 7bc081f6e9b967580c505e7d4624867d15a80b5342f8c72c09c1ba1a694c8991
MD5 0e22e7a14e13db4fad0a6e9e18602e6a
BLAKE2b-256 6de085ff3607539ed83f35d31671c9dceafbfdab3a97cbb586125284d3d59da0

See more details on using hashes here.

File details

Details for the file htmltestrunner_rv-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for htmltestrunner_rv-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6c89bb137165bdbf6ceba32dc6eeed2300fe50bf46c01e0d99fb9e87faf414db
MD5 e7dc3efbaecfb4b7b4a63abdfdbb7e3a
BLAKE2b-256 9c77a5a6aa04b5e9a7b581c81724f983cba72e7ceaeeef581f203245bcadac12

See more details on using hashes here.

Supported by

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