Code Monkey home page Code Monkey logo

htmltestrunner's Introduction

Synopsis

HTMLTestRunner.py is a module extension above unittest in Python. With it, you can quickly generate an HTML test report. HTMLTestRunner is a counterpart to unittest's TextTestRunner. E.g.

Code Example

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.

# 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)

Motivation

HTMLTestRunner was an easy to use library as a developer to quickly see a webpage based report. It was originally created by tungwaiyip and upgraded recently for Python 3 by dash0002. In it's current iteration and maintenance, our goals are still the same; to be able to quickly generate an HTML test report.

Installation

Supporting Python 3 - 3.5

PIP (recommended)

Copy and paste

You can take a copy of the HTMLTestRunner.py and include it directly in your Project as-is.

Tests

python test_HTMLTestRunner.py

Contributors

Contributions are gladly accepted as this is a side project at best. Please, also consider this when looking at feedback cycles, issues, pull requests, etc.

License

HTMLTestRunner is licensed under http://choosealicense.com/licenses/bsd-3-clause/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.