Skip to main content

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"""

Metadata

Release files for unittest-prettify 1.0.post4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unittest-prettify 1.0.post4
File Size Uploaded Provenance
unittest-prettify-1.0.post4.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for unittest-prettify 1.0.post4
File Interpreter ABI Platform
unittest_prettify-1.0.post4-py3-none-any.whl Python 3 none any Details

Total release size: 6.7 kB

Release files / unittest-prettify-1.0.post4.tar.gz

Download URL unittest-prettify-1.0.post4.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1bfa34cea29943cf6b911f19ccb02d54d489b22d4a3ef225100b1841af84d60f
BLAKE2b-256 checksum
How to use checksums
f1d9dfd4e2158a4c21a47d85a9ab4a69533de135fe31056e5d73e3faa02786be
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / unittest_prettify-1.0.post4-py3-none-any.whl

Download URL unittest_prettify-1.0.post4-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5baf5aea58f4d5c7c4f72e9d3c59140ff059f8743af8f43810ecce7ce969756
BLAKE2b-256 checksum
How to use checksums
6b88a3071dbcd7c682d0b35c43efcde16a0a50704ce17e60a9c272d572cf6b73
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for unittest-prettify 1.0.post4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page