Change in vdsm[master]: testrunner: Add NOSE_COLOR env var

smizrahi at redhat.com smizrahi at redhat.com
Thu Feb 21 21:37:37 UTC 2013


Saggi Mizrahi has uploaded a new change for review.

Change subject: testrunner: Add NOSE_COLOR env var
......................................................................

testrunner: Add NOSE_COLOR env var

Allows forcing output of color to non terminal.

Useful for case where the errors are longer then the scrollback:

    NOSE_COLOR=1 ./run_tests_local.sh jsonRpcTests | less -R

Change-Id: I4eb684c73f6254a35707fcd7f3f6b30eaaae9f2f
Signed-off-by: Saggi Mizrahi <smizrahi at redhat.com>
---
M tests/testrunner.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/12302/1

diff --git a/tests/testrunner.py b/tests/testrunner.py
index 2c55a51..1880736 100644
--- a/tests/testrunner.py
+++ b/tests/testrunner.py
@@ -115,7 +115,7 @@
 
 
 def colorWrite(stream, text, color):
-    if os.isatty(stream.fileno()):
+    if os.isatty(stream.fileno()) or os.environ.get("NOSE_COLOR", False):
         stream.write('\x1b[%s;1m%s\x1b[0m' % (color, text))
     else:
         stream.write(text)


--
To view, visit http://gerrit.ovirt.org/12302
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4eb684c73f6254a35707fcd7f3f6b30eaaae9f2f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list