From e3406e0818f4496f5d3c601da66b6dca9f53c3ba Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 16 Jan 2018 19:35:32 -0200 Subject: [PATCH] Show usage errors in red --- _pytest/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_pytest/config.py b/_pytest/config.py index ce7468f72..22bf6c60c 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -60,8 +60,9 @@ def main(args=None, plugins=None): finally: config._ensure_unconfigure() except UsageError as e: + tw = py.io.TerminalWriter(sys.stderr) for msg in e.args: - sys.stderr.write("ERROR: %s\n" % (msg,)) + tw.line("ERROR: {}\n".format(msg), red=True) return 4