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

+1-2
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

+1-1
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)