Replace check.runtest with own function to avoid UnicodeEncodeErrors