mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
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")).
This commit is contained in:
parent
3f44e3db72
commit
e81fc9b9db
@ -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)
|
||||
$$;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user