]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#17448: Make test_sax skip if there are no xml parsers.
authorR David Murray <rdmurray@bitdance.com>
Mon, 18 Mar 2013 04:18:12 +0000 (00:18 -0400)
committerR David Murray <rdmurray@bitdance.com>
Mon, 18 Mar 2013 04:18:12 +0000 (00:18 -0400)
Patch by Rafael Santos.

Lib/test/test_sax.py
Misc/ACKS
Misc/NEWS

index bfa7d72d1644e94f63b8c1227ca21b83225e7815..3efd97245829e135de88a5054ded8077163b2cf6 100644 (file)
@@ -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")
index d8533c4351b206ba504b24e524dc0bc593d8dad5..b5c80592f5cd9dba325903dbf32c3fed9c730b1e 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -947,6 +947,7 @@ Rich Salz
 Kevin Samborn
 Adrian Sampson
 Ilya Sandler
+Rafael Santos
 Mark Sapiro
 Ty Sarna
 Hugh Sasse
index c9c854dd2d57828b4b5f74e9ee58c04a6dbdb66b..af2231821bc9cc0b041c5d080555c19c17413268 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -967,6 +967,9 @@ Extension Modules
 Tests
 -----
 
+- Issue #17448: test_sax now skips if there are no xml parsers available
+  instead of raising an ImportError.
+
 - Issue #11420: make test suite pass with -B/DONTWRITEBYTECODE set.
   Initial patch by Thomas Wouters.