tests: In dump, use repr instead of backslash for Python 3 compatibility.