From c41f4fd2a11e1326065114089ae3da788e2a447d Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 19 Feb 2022 14:04:31 -0800 Subject: [PATCH] fix behavior that was confusing pytest --- jrnl/output.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jrnl/output.py b/jrnl/output.py index b67cb0a7..b98a661f 100644 --- a/jrnl/output.py +++ b/jrnl/output.py @@ -39,22 +39,18 @@ def list_journals(configuration): return result -MessageProps = namedtuple("MessageProps", ["value", "color", "pipe"]) +MessageProps = namedtuple("MessageProps", ["value", "color"]) class Message(Enum): - NORMAL = MessageProps(0, "cyan", sys.stderr) - WARNING = MessageProps(1, "yellow", sys.stderr) - ERROR = MessageProps(2, "red", sys.stderr) + NORMAL = MessageProps(0, "cyan") + WARNING = MessageProps(1, "yellow") + ERROR = MessageProps(2, "red") @property def color(self): return self.value.color - @property - def pipe(self): - return self.value.pipe - def print_msg(title: str, body: str = "", msg: Message = Message.NORMAL): @@ -64,4 +60,4 @@ def print_msg(title: str, body: str = "", msg: Message = Message.NORMAL): if body: result += f"\n{body}" - print(result, file=msg.pipe) + print(result, file=sys.stderr)