Skip to content

Commit 84d457e

Browse files
committed
Format PL/Python module contents test vertically
It makes it readable again and makes merges more manageable.
1 parent 4f714b2 commit 84d457e

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

src/pl/plpython/expected/plpython_test.out

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,34 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
3636
(3 rows)
3737

3838
-- check module contents
39-
CREATE FUNCTION module_contents() RETURNS text AS
39+
CREATE FUNCTION module_contents() RETURNS SETOF text AS
4040
$$
4141
contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
4242
contents.sort()
43-
return ", ".join(contents)
43+
return contents
4444
$$ LANGUAGE plpythonu;
4545
select module_contents();
46-
module_contents
47-
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
48-
Error, Fatal, SPIError, cursor, debug, error, execute, fatal, info, log, notice, prepare, quote_ident, quote_literal, quote_nullable, spiexceptions, subtransaction, warning
49-
(1 row)
46+
module_contents
47+
-----------------
48+
Error
49+
Fatal
50+
SPIError
51+
cursor
52+
debug
53+
error
54+
execute
55+
fatal
56+
info
57+
log
58+
notice
59+
prepare
60+
quote_ident
61+
quote_literal
62+
quote_nullable
63+
spiexceptions
64+
subtransaction
65+
warning
66+
(18 rows)
5067

5168
CREATE FUNCTION elog_test_basic() RETURNS void
5269
AS $$

src/pl/plpython/sql/plpython_test.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ select "Argument test #1"(users, fname, lname) from users where lname = 'doe' or
2727

2828

2929
-- check module contents
30-
CREATE FUNCTION module_contents() RETURNS text AS
30+
CREATE FUNCTION module_contents() RETURNS SETOF text AS
3131
$$
3232
contents = list(filter(lambda x: not x.startswith("__"), dir(plpy)))
3333
contents.sort()
34-
return ", ".join(contents)
34+
return contents
3535
$$ LANGUAGE plpythonu;
3636

3737
select module_contents();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy