mirror of
https://github.com/postgres/postgres.git
synced 2025-06-10 09:21:54 +03:00
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.
This commit is contained in:
@ -134,7 +134,7 @@ with plpy.subtransaction():
|
|||||||
except plpy.SPIError, e:
|
except plpy.SPIError, e:
|
||||||
if not swallow:
|
if not swallow:
|
||||||
raise
|
raise
|
||||||
plpy.notice("Swallowed %r" % e)
|
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
|
||||||
return "ok"
|
return "ok"
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
SELECT subtransaction_nested_test();
|
SELECT subtransaction_nested_test();
|
||||||
@ -153,7 +153,7 @@ SELECT * FROM subtransaction_tbl;
|
|||||||
|
|
||||||
TRUNCATE subtransaction_tbl;
|
TRUNCATE subtransaction_tbl;
|
||||||
SELECT subtransaction_nested_test('t');
|
SELECT subtransaction_nested_test('t');
|
||||||
NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
|
NOTICE: Swallowed SyntaxError('syntax error at or near "error"')
|
||||||
CONTEXT: PL/Python function "subtransaction_nested_test"
|
CONTEXT: PL/Python function "subtransaction_nested_test"
|
||||||
subtransaction_nested_test
|
subtransaction_nested_test
|
||||||
----------------------------
|
----------------------------
|
||||||
@ -179,7 +179,7 @@ with plpy.subtransaction():
|
|||||||
return "ok"
|
return "ok"
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
SELECT subtransaction_deeply_nested_test();
|
SELECT subtransaction_deeply_nested_test();
|
||||||
NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
|
NOTICE: Swallowed SyntaxError('syntax error at or near "error"')
|
||||||
CONTEXT: PL/Python function "subtransaction_nested_test"
|
CONTEXT: PL/Python function "subtransaction_nested_test"
|
||||||
SQL statement "SELECT subtransaction_nested_test('t')"
|
SQL statement "SELECT subtransaction_nested_test('t')"
|
||||||
PL/Python function "subtransaction_deeply_nested_test"
|
PL/Python function "subtransaction_deeply_nested_test"
|
||||||
|
@ -128,7 +128,7 @@ with plpy.subtransaction():
|
|||||||
except plpy.SPIError, e:
|
except plpy.SPIError, e:
|
||||||
if not swallow:
|
if not swallow:
|
||||||
raise
|
raise
|
||||||
plpy.notice("Swallowed %r" % e)
|
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
|
||||||
return "ok"
|
return "ok"
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
ERROR: could not compile PL/Python function "subtransaction_nested_test"
|
ERROR: could not compile PL/Python function "subtransaction_nested_test"
|
||||||
|
@ -128,7 +128,7 @@ with plpy.subtransaction():
|
|||||||
except plpy.SPIError, e:
|
except plpy.SPIError, e:
|
||||||
if not swallow:
|
if not swallow:
|
||||||
raise
|
raise
|
||||||
plpy.notice("Swallowed %r" % e)
|
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
|
||||||
return "ok"
|
return "ok"
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
ERROR: could not compile PL/Python function "subtransaction_nested_test"
|
ERROR: could not compile PL/Python function "subtransaction_nested_test"
|
||||||
|
@ -80,7 +80,7 @@ with plpy.subtransaction():
|
|||||||
except plpy.SPIError, e:
|
except plpy.SPIError, e:
|
||||||
if not swallow:
|
if not swallow:
|
||||||
raise
|
raise
|
||||||
plpy.notice("Swallowed %r" % e)
|
plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
|
||||||
return "ok"
|
return "ok"
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user