From 7fa025e9b7e909f48a9d2ca20edd18a72b2ffcac Mon Sep 17 00:00:00 2001 From: Marcel Wilson Date: Tue, 2 Apr 2024 16:59:13 -0400 Subject: [PATCH] keeping logic where a non-mock object may have `< >` surrounding the str output whereby we dont need to add another. --- screenpy/speech_tools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/screenpy/speech_tools.py b/screenpy/speech_tools.py index 9a78cda..1ecdfa6 100644 --- a/screenpy/speech_tools.py +++ b/screenpy/speech_tools.py @@ -68,4 +68,8 @@ def represent_prop(item: str | T | mock.Mock) -> str | mock.Mock: if isinstance(item, str): return repr(item) + description = str(item) + if description[:1] == "<" and description[-1:] == ">": + return description + return f"<{item}>"