summaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-03-28 11:01:40 -0400
committerPeter Eisentraut <peter_e@gmx.net>2018-03-28 11:01:40 -0400
commite81fc9b9dbf9d744dcc9fb210e4353a350be1e22 (patch)
treee257ad9143b8c6243252442530b27718c3e476a4 /contrib/jsonb_plpython
parent3f44e3db72ad4097aae078c075a9b3cb3d6b761b (diff)
downloadpostgresql-e81fc9b9dbf9d744dcc9fb210e4353a350be1e22.tar.gz
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")).
Diffstat (limited to 'contrib/jsonb_plpython')
-rw-r--r--contrib/jsonb_plpython/expected/jsonb_plpython.out3
-rw-r--r--contrib/jsonb_plpython/sql/jsonb_plpython.sql2
2 files changed, 2 insertions, 3 deletions
diff --git a/contrib/jsonb_plpython/expected/jsonb_plpython.out b/contrib/jsonb_plpython/expected/jsonb_plpython.out
index bed24010e1..22a7e53b69 100644
--- a/contrib/jsonb_plpython/expected/jsonb_plpython.out
+++ b/contrib/jsonb_plpython/expected/jsonb_plpython.out
@@ -6,11 +6,10 @@ LANGUAGE plpythonu
TRANSFORM FOR TYPE jsonb
AS $$
assert isinstance(val, dict)
-plpy.info(sorted(val.items()))
+assert(val == {'a': 1, 'c': 'NULL'})
return len(val)
$$;
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
-INFO: [('a', Decimal('1')), ('c', 'NULL')]
test1
-------
2
diff --git a/contrib/jsonb_plpython/sql/jsonb_plpython.sql b/contrib/jsonb_plpython/sql/jsonb_plpython.sql
index eaf2f625a6..b4b0820afe 100644
--- a/contrib/jsonb_plpython/sql/jsonb_plpython.sql
+++ b/contrib/jsonb_plpython/sql/jsonb_plpython.sql
@@ -6,7 +6,7 @@ LANGUAGE plpythonu
TRANSFORM FOR TYPE jsonb
AS $$
assert isinstance(val, dict)
-plpy.info(sorted(val.items()))
+assert(val == {'a': 1, 'c': 'NULL'})
return len(val)
$$;