1
0
Fork 0

removing unneeded Nones from output

This commit is contained in:
ERYoung11 2024-02-04 20:53:23 -06:00
parent 7992426d07
commit 4f9c130339
2 changed files with 6 additions and 5 deletions

View File

@ -437,7 +437,11 @@ class PGExecute:
def handle_notices(n):
nonlocal title
title = f"{title}{n.message_primary}\n{n.message_detail}\n"
title = f"{title}"
if n.message_primary:
title = f"{title}\n{n.message_primary}"
if n.message_detail:
title = f"{title}\n{n.message_detail}"
self.conn.add_notice_handler(handle_notices)

View File

@ -712,10 +712,7 @@ def test_function_notice_order(executor):
result = executor.function_definition("demo_order")
result = run(executor, "select demo_order()")
assert (
"first\nNone\nsecond\nNone\nthird\nNone\nfourth\nNone\nfifth\nNone\nsixth\nNone\n"
in result[0]
)
assert "first\nsecond\nthird\nfourth\nfifth\nsixth" in result[0]
assert "+------------+" in result[1]
assert "| demo_order |" in result[2]
assert "|------------|" in result[3]