change method of test_repr to be compatible with python3