PL/Python: Adjust the regression tests for Python 3.4
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 30 Apr 2014 02:16:16 +0000 (22:16 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 30 Apr 2014 02:16:16 +0000 (22:16 -0400)
The error test case in the plpython_do test resulted in a slightly
different error message with Python 3.4.  So pick a different way to
test it that avoids that and is perhaps also a bit clearer.

src/pl/plpython/expected/plpython_do.out
src/pl/plpython/sql/plpython_do.sql

index d979cf811c7a97f807b35cfe973f82e7cba0e04a..09778120843021c479b6042627ff3096204b3928 100644 (file)
@@ -4,9 +4,9 @@ CONTEXT:  PL/Python anonymous code block
 DO $$ plpy.notice("This is plpython2u.") $$ LANGUAGE plpython2u;
 NOTICE:  This is plpython2u.
 CONTEXT:  PL/Python anonymous code block
-DO $$ nonsense $$ LANGUAGE plpythonu;
-ERROR:  NameError: global name 'nonsense' is not defined
+DO $$ raise Exception("error test") $$ LANGUAGE plpythonu;
+ERROR:  Exception: error test
 CONTEXT:  Traceback (most recent call last):
   PL/Python anonymous code block, line 1, in <module>
-    nonsense 
+    raise Exception("error test") 
 PL/Python anonymous code block
index beb443f95d1b4e2705a37a74d14fcf2451a87241..0e281a08ee8cab26178e661888f8c408717d2876 100644 (file)
@@ -2,4 +2,4 @@ DO $$ plpy.notice("This is plpythonu.") $$ LANGUAGE plpythonu;
 
 DO $$ plpy.notice("This is plpython2u.") $$ LANGUAGE plpython2u;
 
-DO $$ nonsense $$ LANGUAGE plpythonu;
+DO $$ raise Exception("error test") $$ LANGUAGE plpythonu;