Tweak tests to support Python 3.7

Peter Eisentraut <peter_e@gmx.net>

Commit: af9e0d5cdf385d3924e8a8569df6b8314848e242
Author: Peter Eisentraut <peter_e@gmx.net>
Date: 2018-05-06T03:53:05Z
Releases: 9.4.18
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