Commit e81fc9b9 authored by Peter Eisentraut's avatar Peter Eisentraut

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")).
parent 3f44e3db
...@@ -6,11 +6,10 @@ LANGUAGE plpythonu ...@@ -6,11 +6,10 @@ LANGUAGE plpythonu
TRANSFORM FOR TYPE jsonb TRANSFORM FOR TYPE jsonb
AS $$ AS $$
assert isinstance(val, dict) assert isinstance(val, dict)
plpy.info(sorted(val.items())) assert(val == {'a': 1, 'c': 'NULL'})
return len(val) return len(val)
$$; $$;
SELECT test1('{"a": 1, "c": "NULL"}'::jsonb); SELECT test1('{"a": 1, "c": "NULL"}'::jsonb);
INFO: [('a', Decimal('1')), ('c', 'NULL')]
test1 test1
------- -------
2 2
......
...@@ -6,7 +6,7 @@ LANGUAGE plpythonu ...@@ -6,7 +6,7 @@ LANGUAGE plpythonu
TRANSFORM FOR TYPE jsonb TRANSFORM FOR TYPE jsonb
AS $$ AS $$
assert isinstance(val, dict) assert isinstance(val, dict)
plpy.info(sorted(val.items())) assert(val == {'a': 1, 'c': 'NULL'})
return len(val) return len(val)
$$; $$;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment