Fix py3 compatibility in YAML tests