Skip to main content

A simple module to improve the unittest output.

Project description

unittest prettify

license pypi version python versions Build Status Code covarage

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.

unittest prettify aims to be a set of tools to improve the unittest lib output.

Main features

  • Change the test description color in both class and method levels.
  • Support to libraries which use unittest as bese such as Django.

Installing it

pip install unittest-prettify 

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.post4.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

unittest_prettify-1.0.post4-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unittest-prettify-1.0.post4.tar.gz
  • Upload date:
  • Size: 2.8 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.post4.tar.gz
Algorithm Hash digest
SHA256 1bfa34cea29943cf6b911f19ccb02d54d489b22d4a3ef225100b1841af84d60f
MD5 c72c653f9b21252dad937adee079c4b6
BLAKE2b-256 f1d9dfd4e2158a4c21a47d85a9ab4a69533de135fe31056e5d73e3faa02786be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: unittest_prettify-1.0.post4-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.post4-py3-none-any.whl
Algorithm Hash digest
SHA256 d5baf5aea58f4d5c7c4f72e9d3c59140ff059f8743af8f43810ecce7ce969756
MD5 8eede4539a5d12052e3b8dc3a7d319a2
BLAKE2b-256 6b88a3071dbcd7c682d0b35c43efcde16a0a50704ce17e60a9c272d572cf6b73

See more details on using hashes here.

Supported by

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