A couple of tests are failing with Python 3 because of a small problem in the Python code used for the test validators.
This MR fixes the tests in a backward (Python 2) compatible way.