Skip to main content

Python unittest runner with html report.

Project description

'Because testing should help, not constrain.'

Example

  • Source code: my_bugged_module.py

     def my_bugged_function():
         my_var = {'a': 'b'}
         1/0
    
  • Test case: test.py

    from logging import getLogger
    from my_bugged_module import my_bugged_function
    from unittest import TestCase
    
    
    class MyTestCase(TestCase):
    
        def test(self):
            """
            Test example.
            """
            print("Print something")
            getLogger().info("Log message")
            my_bugged_function()
    
  • Result:

    Test report

Use as nose plugin

nosetests --with-html-test test

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

html_test_report-1.0.0.tar.gz (12.6 kB view hashes)

Uploaded Source

Built Distribution

html_test_report-1.0.0-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

Supported by

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