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
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
......
......@@ -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)
$$;
......
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