summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-18 04:20:43 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-03-18 04:20:43 (GMT)
commitf3a1b6efe0b01022ec20b189bb85430e2d8051f5 (patch)
tree36dc5fa2bcdc3d0feac8aa4ddbe29eea7c929335 /Lib/test
parent1f2a49cfc610bfd7cbc85fd263295549377e8094 (diff)
parenta846f5ace80977f922e8295441afc668910fc894 (diff)
downloadcpython-f3a1b6efe0b01022ec20b189bb85430e2d8051f5.zip
cpython-f3a1b6efe0b01022ec20b189bb85430e2d8051f5.tar.gz
cpython-f3a1b6efe0b01022ec20b189bb85430e2d8051f5.tar.bz2
Merge #17448: Make test_sax skip if there are no xml parsers.
Patch by Rafael Santos.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_sax.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 05f66fd..e235a0b 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -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")