]> granicus.if.org Git - postgresql/commitdiff
Tweak tests to support Python 3.7
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 13 Feb 2018 21:13:20 +0000 (16:13 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 6 May 2018 03:34:41 +0000 (23:34 -0400)
Python 3.7 removes the trailing comma in the repr() of
BaseException (see <https://bugs.python.org/issue30399>), leading to
test output differences.  Work around that by composing the equivalent
test output in a more manual way.

src/pl/plpython/expected/plpython_subtransaction.out
src/pl/plpython/expected/plpython_subtransaction_0.out
src/pl/plpython/expected/plpython_subtransaction_5.out
src/pl/plpython/sql/plpython_subtransaction.sql

index da3b312a06b3463fdc67e50983e61015e10de64b..b38cde8d2dbeebd38a4177f8b964c8e8391b025e 100644 (file)
@@ -134,7 +134,7 @@ with plpy.subtransaction():
     except plpy.SPIError, e:
         if not swallow:
             raise
-        plpy.notice("Swallowed %r" % e)
+        plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
 return "ok"
 $$ LANGUAGE plpythonu;
 SELECT subtransaction_nested_test();
@@ -153,7 +153,7 @@ SELECT * FROM subtransaction_tbl;
 
 TRUNCATE subtransaction_tbl;
 SELECT subtransaction_nested_test('t');
-NOTICE:  Swallowed SyntaxError('syntax error at or near "error"',)
+NOTICE:  Swallowed SyntaxError('syntax error at or near "error"')
  subtransaction_nested_test 
 ----------------------------
  ok
@@ -178,7 +178,7 @@ with plpy.subtransaction():
 return "ok"
 $$ LANGUAGE plpythonu;
 SELECT subtransaction_deeply_nested_test();
-NOTICE:  Swallowed SyntaxError('syntax error at or near "error"',)
+NOTICE:  Swallowed SyntaxError('syntax error at or near "error"')
  subtransaction_deeply_nested_test 
 -----------------------------------
  ok
index e6cc38a0338d19e6705f02cd5f325bc009e39cd2..cc6d9c0e93d35a0b700a29f8a6d3b91a6fa7b03f 100644 (file)
@@ -128,7 +128,7 @@ with plpy.subtransaction():
     except plpy.SPIError, e:
         if not swallow:
             raise
-        plpy.notice("Swallowed %r" % e)
+        plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
 return "ok"
 $$ LANGUAGE plpythonu;
 ERROR:  could not compile PL/Python function "subtransaction_nested_test"
index 6fbafa31661a6e89bbc5164bedc0363c32cc6aab..c3be1302680ea9df79923bfe2fbe6fe8dee6fcb3 100644 (file)
@@ -128,7 +128,7 @@ with plpy.subtransaction():
     except plpy.SPIError, e:
         if not swallow:
             raise
-        plpy.notice("Swallowed %r" % e)
+        plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
 return "ok"
 $$ LANGUAGE plpythonu;
 ERROR:  could not compile PL/Python function "subtransaction_nested_test"
index 3c188e3dd2dc2b1ea8cb1cf1cbf1745edcda53a7..398c65720ced41349550356f6e1fb115d104d998 100644 (file)
@@ -80,7 +80,7 @@ with plpy.subtransaction():
     except plpy.SPIError, e:
         if not swallow:
             raise
-        plpy.notice("Swallowed %r" % e)
+        plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
 return "ok"
 $$ LANGUAGE plpythonu;