From 2cfb1c6f77734db81b6e74bcae630f93b94f69be Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 11 May 2012 23:01:15 +0300 Subject: PL/Python: Adjust the regression tests for Python 3.3 The string representation of ImportError changed. Remove printing that; it's not necessary for the test. The order in which members of a dict are printed changed. But this was always implementation-dependent, so we have just been lucky for a long time. Do the printing the hard way to ensure sorted order. --- src/pl/plpython/sql/plpython_params.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/pl/plpython/sql/plpython_params.sql') diff --git a/src/pl/plpython/sql/plpython_params.sql b/src/pl/plpython/sql/plpython_params.sql index d97e0b8549..f580abe53d 100644 --- a/src/pl/plpython/sql/plpython_params.sql +++ b/src/pl/plpython/sql/plpython_params.sql @@ -14,7 +14,14 @@ $$ LANGUAGE plpythonu; CREATE FUNCTION test_param_names2(u users) RETURNS text AS $$ assert u == args[0] -return str(u) +if isinstance(u, dict): + # stringify dict the hard way because otherwise the order is implementation-dependent + u_keys = list(u.keys()) + u_keys.sort() + s = '{' + ', '.join([repr(k) + ': ' + repr(u[k]) for k in u_keys]) + '}' +else: + s = str(u) +return s $$ LANGUAGE plpythonu; -- use deliberately wrong parameter names -- cgit v1.2.1