#17448: Make test_sax skip if there are no xml parsers.
Patch by Rafael Santos.
This commit is contained in:
parent
dd246171e4
commit
a846f5ace8
|
@ -3,11 +3,12 @@
|
|||
|
||||
from xml.sax import make_parser, ContentHandler, \
|
||||
SAXException, SAXReaderNotAvailable, SAXParseException
|
||||
import unittest
|
||||
try:
|
||||
make_parser()
|
||||
except SAXReaderNotAvailable:
|
||||
# don't try to test this module if we cannot create a parser
|
||||
raise ImportError("no XML parsers available")
|
||||
raise unittest.SkipTest("no XML parsers available")
|
||||
from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \
|
||||
XMLFilterBase
|
||||
from xml.sax.expatreader import create_parser
|
||||
|
@ -18,7 +19,6 @@ import os.path
|
|||
import shutil
|
||||
from test import support
|
||||
from test.support import findfile, run_unittest
|
||||
import unittest
|
||||
|
||||
TEST_XMLFILE = findfile("test.xml", subdir="xmltestdata")
|
||||
TEST_XMLFILE_OUT = findfile("test.xml.out", subdir="xmltestdata")
|
||||
|
|
|
@ -947,6 +947,7 @@ Rich Salz
|
|||
Kevin Samborn
|
||||
Adrian Sampson
|
||||
Ilya Sandler
|
||||
Rafael Santos
|
||||
Mark Sapiro
|
||||
Ty Sarna
|
||||
Hugh Sasse
|
||||
|
|
Loading…
Reference in New Issue