Tweak tests to support Python 3.7

Peter Eisentraut <peter_e@gmx.net>

Commit: e7f90471590025ccb522562bec8513238805395b
Author: Peter Eisentraut <peter_e@gmx.net>
Date: 2018-05-06T03:54:04Z
Releases: 9.3.23
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.

Files