Issue #9425: skip tests if a filename is not encodable

This commit is contained in:
Victor Stinner 2010-08-07 10:09:35 +00:00
parent 87c9d6cf9c
commit 6c6f851eae
6 changed files with 29 additions and 4 deletions

View file

@ -13,6 +13,7 @@
import sys
import cgi
import unittest
from test import support
from test.support import findfile
@ -20,6 +21,10 @@ from test.support import findfile
from xml.etree import ElementTree as ET
SIMPLE_XMLFILE = findfile("simple.xml", subdir="xmltestdata")
try:
SIMPLE_XMLFILE.encode("utf8")
except UnicodeEncodeError:
raise unittest.SkipTest("filename is not encodable to utf8")
SIMPLE_NS_XMLFILE = findfile("simple-ns.xml", subdir="xmltestdata")
SAMPLE_XML = """\