summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2022-04-07 13:53:05 +0200
committerPhil Sutter <phil@nwl.cc>2022-04-08 16:21:32 +0200
commit6fa4ff56385831f01bd9d993178969a4eddbcdbf (patch)
tree73d3bbc49a22c04804ff2b0cc38b7b3703469272 /tests
parentf561a0ccb0524eded2f2b9160b5c97bc569cc5e4 (diff)
tests: py: Don't colorize output if stderr is redirected
Cover for calls with '2>/tmp/log' and avoid printing escape sequences to that file. One could still keep colored output on stdout, but that required a printing routine for non-errors. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/py/nft-test.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 04dac8d7..b66a33c2 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -39,7 +39,7 @@ signal_received = 0
class Colors:
- if sys.stdout.isatty():
+ if sys.stdout.isatty() and sys.stderr.isatty():
HEADER = '\033[95m'
GREEN = '\033[92m'
YELLOW = '\033[93m'