fix behavior that was confusing pytest

This commit is contained in:
Jonathan Wren 2022-02-19 14:04:31 -08:00
parent f5e6705e76
commit c41f4fd2a1

View file

@ -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)