summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-03-18 00:21:43 -0400
committerR David Murray <rdmurray@bitdance.com>2013-03-18 00:21:43 -0400
commit0351928359b372a37838980190beecebf5f5c3c7 (patch)
tree73b07cc1b4e06f3597c43b6c74367b064db1352f
parentfbb1815491d6a4516629c6d6b8b9c2b08b326089 (diff)
parentf3a1b6efe0b01022ec20b189bb85430e2d8051f5 (diff)
downloadcpython-git-0351928359b372a37838980190beecebf5f5c3c7.tar.gz
Merge #17448: Make test_sax skip if there are no xml parsers.
Patch by Rafael Santos.
-rw-r--r--Lib/test/test_sax.py4
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index 05f66fdca1..e235a0b002 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")
diff --git a/Misc/ACKS b/Misc/ACKS
index 954206326f..4d6266e5f4 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1065,6 +1065,7 @@ Kevin Samborn
Adrian Sampson
James Sanders
Ilya Sandler
+Rafael Santos
Mark Sapiro
Ty Sarna
Hugh Sasse
diff --git a/Misc/NEWS b/Misc/NEWS
index f55ba1e463..5d71af114f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -940,6 +940,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.