Skip to content

langner/HTMLTestRunner

 
 

Repository files navigation

HTMLTestRunner is an extension to the Python standard library's unittest module.
It generates easy to use HTML test reports. HTMLTestRunner is released under a
BSD style license.

Only a single file module HTMLTestRunner.py is needed to generate your report.

A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.

The simplest way to use this is to invoke its main method. E.g.

    import unittest
    import HTMLTestRunner

    ... define your tests ...

    if __name__ == '__main__':
        HTMLTestRunner.main()


For more customization options, instantiates a HTMLTestRunner object.
HTMLTestRunner is a counterpart to unittest's TextTestRunner. E.g.

    # output to a file
    fp = file('my_report.html', 'wb')
    runner = HTMLTestRunner.HTMLTestRunner(
                stream=fp,
                title='My unit test',
                description='This demonstrates the report output by HTMLTestRunner.'
                )

    # Use an external stylesheet.
    # See the Template_mixin class for more customizable options
    runner.STYLESHEET_TMPL = '<link rel="stylesheet" href="my_stylesheet.css" type="text/css">'

    # run the test
    runner.run(my_test_suite)

# URL: http://tungwaiyip.info/software/HTMLTestRunner.html

About

HTMLTestRunner is an extension to the Python standard library's unittest module. It generates easy to use HTML test reports.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 72.5%
  • HTML 27.5%