Skip to content

Commit e81fc9b

Browse files
committed
Fix jsonb_plpython tests on older Python versions
Rewrite one test to avoid a case where some Python versions have output format differences (Decimal('1') vs Decimal("1")).
1 parent 3f44e3d commit e81fc9b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

contrib/jsonb_plpython/expected/jsonb_plpython.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ LANGUAGE plpythonu
66
TRANSFORM FOR TYPE jsonb
77
AS $$
88
assert isinstance(val, dict)
9-
plpy.info(sorted(val.items()))
9+
assert(val == {'a': 1, 'c': 'NULL'})
1010
return len(val)
1111
$$;
1212
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
13-
INFO: [('a', Decimal('1')), ('c', 'NULL')]
1413
test1
1514
-------
1615
2

contrib/jsonb_plpython/sql/jsonb_plpython.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LANGUAGE plpythonu
66
TRANSFORM FOR TYPE jsonb
77
AS $$
88
assert isinstance(val, dict)
9-
plpy.info(sorted(val.items()))
9+
assert(val == {'a': 1, 'c': 'NULL'})
1010
return len(val)
1111
$$;
1212

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