Make unittest output less distracting
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Tue, 12 Feb 2019 10:30:37 +0000 (11:30 +0100)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Tue, 12 Feb 2019 10:30:37 +0000 (11:30 +0100)
That blinking really catches my eye every time, quite distracting.
Also limit output to a single line.

test/test_text_helpers.py

index adc3daa..f341aad 100644 (file)
@@ -39,9 +39,10 @@ class TextHelpersTester(unittest.TestCase):
         """ tests whether color functions do not raise errors """
         for color in COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, \
                 COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE:
-            exec('{0}("{0}")'.format(color))
-        for style in 'normal', 'bold', 'underline', 'blink', 'reverse':
-            exec('{0}("{0}")'.format(style))
+            exec('{0}("{0}", end=", ")'.format(color))
+        for style in 'normal', 'bold', 'underline', 'reverse':
+            exec('{0}("{0}", end=", ")'.format(style))
+        # leave out style 'blink' since it is just too distracting
 
     def test_shortening(self):
         """ test function head_and_tail """