Skip to main content

A simple module to improve the unittest output.

Project description

unittest Prettify

license pypi version python versions

A simple module to improve the unittest output.

Which unittest output do you prefer?

If you prefer the one in the right side, this module is for you.

It aims to pretiffy the description in the unittest output by colorizing it.

Using it

Changing the color for a whole test case:

The test_1() and test_2() will inherit the green color from the class definition.

import unittest
from unittest_prettify.colorize import (
    colorize,
    GREEN,
)

@colorize(color=GREEN)
class Foo(unittest.TestCase):
    def test_1(self):
        """This test comment should be with the Class color set as GREEN"""

    def test_2(self):
        """This test comment should be with the Class color set as GREEN"""

Changing the color for a specific test:

The test_1() will inherit the green color from the class definition, but test_2() will overwrite the color by red.

import unittest
from unittest_prettify.colorize import (
    colorize,
    GREEN,
    RED,
)

@colorize(color=GREEN)
class Foo(unittest.TestCase):
    def test_1(self):
        """This test comment should be with the Class color set as GREEN"""

    @colorize(color=RED)
    def test_2(self):
        """This test comment should be RED"""

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

unittest-prettify-1.0.post1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unittest_prettify-1.0.post1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file unittest-prettify-1.0.post1.tar.gz.

File metadata

  • Download URL: unittest-prettify-1.0.post1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for unittest-prettify-1.0.post1.tar.gz
Algorithm Hash digest
SHA256 de2d4c312ac2a2047c11ff3450563d553fade9b230e494abd0c3b9cf1d79da9f
MD5 952a997faca146ebca4be0de9de1d6cb
BLAKE2b-256 028fe66f95aad2acd603652d0c2415b89e2e9f53b410b693bc29b2ecf71f7fbc

See more details on using hashes here.

File details

Details for the file unittest_prettify-1.0.post1-py3-none-any.whl.

File metadata

  • Download URL: unittest_prettify-1.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for unittest_prettify-1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb916406e93db48cbfeffe9f11234cfe3f25670ddb14ee17e9e385c320bb718c
MD5 2334b7b2ba099d23537b796f55c41f13
BLAKE2b-256 e8f2f47ea260406f43efc454ac56b6eb5e8dc5aaa233c536dcf1238bc3e24f6a

See more details on using hashes here.

Supported by

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