A simple module to improve the unittest output.
Project description
unittest Prettify
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
Built Distribution
Close
Hashes for unittest_prettify-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a08b39660f1e03d851047359905a8910627115fb7b620fe14e6db5c5cc04068e |
|
MD5 | 4f6d26294b7f92bac5e94e9355ace1bf |
|
BLAKE2b-256 | cf3cfa76c6d6509671c8de5210b6a39b4558cee4e0f0e0b1a33f80ae3171f29c |