Metadata-Version: 2.1
Name: html_reporter
Version: 0.2.6
Summary: A TestRunner for use with the Python unittest framework, which generates report in nice HTML files.
Home-page: https://github.com/phongnt570/html-reporter
Author: Tuan-Phong Nguyen
Author-email: tuanphong94@gmail.com
License: MIT license
Keywords: html_reporter,unittest,testrunner,html-reporter,html-test-runner,htmltestrunner
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
License-File: LICENSE
License-File: AUTHORS.rst

=============
html-reporter
=============


.. image:: https://img.shields.io/pypi/v/html-reporter.svg
        :target: https://pypi.python.org/pypi/html-reporter

.. image:: https://img.shields.io/travis/phongnt570/html-reporter.svg
        :target: https://travis-ci.com/phongnt570/html-reporter

.. image:: https://readthedocs.org/projects/html-reporter/badge/?version=latest
        :target: https://html-reporter.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status

.. image:: https://img.shields.io/github/license/phongnt570/html-reporter.svg
        :target: https://opensource.org/licenses/MIT
        :alt: License

.. image:: https://img.shields.io/pypi/pyversions/html-reporter.svg
        :target: https://pypi.org/project/html-reporter
        :alt: Supported Python Versions


A ``TestRunner`` for use with the Python unit testing framework. It generates a report in an HTML file to show the results
at a glance. This package was inspired by ``HTMLTestRunner.py`` written by `Wai Yip Tung`_ and began with transforming the old code to use ``Jinja2`` template and adopting Bootstrap 5 CSS.


.. image:: _static/demo.gif
        :alt: Test Results
        :height: 300px
        :align: center



Getting started
---------------

Prerequisites
~~~~~~~~~~~~~

``html-reporter`` requires Python 3.7 or later.

Install
~~~~~~~

Install the package via pip:

.. code-block:: console

    $ pip install html-reporter


Usage
~~~~~

``HTMLTestRunner`` is a counterpart to ``unittest.TextTestRunner``. Instantiate an ``HTMLTestRunner`` object and use it to run
your test suite.

Example using ``unittest.main``:

.. code-block:: python

    import unittest

    from html_reporter import HTMLTestRunner

    # output to a file
    if __name__ == "main":
        runner = HTMLTestRunner(
            report_filepath="my_report.html",
            title="My unit test",
            description="This demonstrates the report output by HTMLTestRunner.",
            open_in_browser=True
        )

        # run the test
        unittest.main(testRunner=runner)

Example using ``unittest.TestSuite``:

.. code-block:: python

    import unittest
    from html_reporter import HTMLTestRunner

    # output to a file
    if __name__ == "main":
        my_test_suite = unittest.TestSuite()  # define your test suite
        # add your test cases:
        # my_test_suite.addTest(...)

        runner = HTMLTestRunner(
            report_filepath="my_report.html",
            title="My unit test",
            description="This demonstrates the report output by HTMLTestRunner.",
            open_in_browser=True
        )

        # run the test
        runner.run(my_test_suite)


* Free software: MIT license
* Documentation: https://html-reporter.readthedocs.io.


Features
--------

TODO
----

- [x] Switch to Jinja2 template
- [x] Refactor
- [x] Add support for skipped tests
- [x] Release pypi package
- [ ] Option for combine/separate report files
- [ ] Add tests
- [ ] Improve documentations


Credits
-------

- This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
- This package was inspired by ``HTMLTestRunner.py`` written by `Wai Yip Tung`_.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
.. _`Wai Yip Tung`: http://tungwaiyip.info/about.html


=======
History
=======

0.2.6 (2022-05-13)
------------------

* First tested release on pypi.
* Support and tested with Python3.7 -> Python 3.9.
