aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-02-13 16:13:20 -0500
committerPeter Eisentraut <peter_e@gmx.net>2018-05-05 23:03:44 -0400
commit8f1787a8f3f3584c70255372c1034d8990eaed9b (patch)
tree807b34781a2c093a86b205337c8d61ff1b859c19 /src
parent0ebb3a4e16d246c8749a1e6e3e59e9db3e408200 (diff)
downloadpostgresql-8f1787a8f3f3584c70255372c1034d8990eaed9b.tar.gz
postgresql-8f1787a8f3f3584c70255372c1034d8990eaed9b.zip
Tweak tests to support Python 3.7
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.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction.out6
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction_0.out2
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction_5.out2
-rw-r--r--src/pl/plpython/sql/plpython_subtransaction.sql2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out
index da3b312a06b..b38cde8d2db 100644
--- a/src/pl/plpython/expected/plpython_subtransaction.out
+++ b/src/pl/plpython/expected/plpython_subtransaction.out
@@ -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
diff --git a/src/pl/plpython/expected/plpython_subtransaction_0.out b/src/pl/plpython/expected/plpython_subtransaction_0.out
index e6cc38a0338..cc6d9c0e93d 100644
--- a/src/pl/plpython/expected/plpython_subtransaction_0.out
+++ b/src/pl/plpython/expected/plpython_subtransaction_0.out
@@ -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"
diff --git a/src/pl/plpython/expected/plpython_subtransaction_5.out b/src/pl/plpython/expected/plpython_subtransaction_5.out
index 6fbafa31661..c3be1302680 100644
--- a/src/pl/plpython/expected/plpython_subtransaction_5.out
+++ b/src/pl/plpython/expected/plpython_subtransaction_5.out
@@ -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"
diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql
index 3c188e3dd2d..398c65720ce 100644
--- a/src/pl/plpython/sql/plpython_subtransaction.sql
+++ b/src/pl/plpython/sql/plpython_subtransaction.sql
@@ -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;