colour-runner

0.1.1 · abandoned · verified Thu Apr 16

colour-runner is a Python library designed to provide color formatting for standard `unittest` test output. The project's last release was 0.1.1 in October 2018, and it has seen no significant updates since then. It is considered abandoned due to lack of maintenance, making it potentially incompatible with newer Python versions and modern testing practices.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use `ColourTextTestRunner` with a standard `unittest.TestCase` suite to get colored output in the terminal.

import unittest
from colour_runner.runner import ColourTextTestRunner

class ExampleTests(unittest.TestCase):
    def test_success(self):
        self.assertTrue(True)

    def test_failure(self):
        self.fail("This test is designed to fail")

    @unittest.skip("demonstrating skipping a test")
    def test_skipped(self):
        self.fail("This test should not run")

if __name__ == '__main__':
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(ExampleTests))
    runner = ColourTextTestRunner(verbosity=2)
    print("\nRunning tests with colour-runner:\n")
    runner.run(suite)

view raw JSON →