aboutsummaryrefslogtreecommitdiffstats
path: root/tests/util/color.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util/color.py')
-rw-r--r--tests/util/color.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/util/color.py b/tests/util/color.py
new file mode 100644
index 000000000..4ddd31cab
--- /dev/null
+++ b/tests/util/color.py
@@ -0,0 +1,12 @@
+
+'''Function to print a colored line to terminal'''
+
+RED='\033[0;31m%s\033[m'
+
+def print_colored(message, color=RED):
+ print color % message
+
+if __name__ == '__main__':
+ print '42 - the answer'
+ print_colored("But what's the question?")
+ print 'Hum?'