[Python-checkins] cpython (merge 3.3 -> default): Merge #17448: Make test_sax skip if there are no xml parsers.
r.david.murray
python-checkins at python.org
Mon Mar 18 05:26:07 CET 2013
http://hg.python.org/cpython/rev/59621d4f1171
changeset: 82727:59621d4f1171
parent: 82723:406c6fd7e753
parent: 82726:3ab80610b2a2
user: R David Murray <rdmurray at bitdance.com>
date: Mon Mar 18 00:21:43 2013 -0400
summary:
Merge #17448: Make test_sax skip if there are no xml parsers.
Patch by Rafael Santos.
files:
Lib/test/test_sax.py | 4 ++--
Misc/ACKS | 1 +
Misc/NEWS | 3 +++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
--- 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 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
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1065,6 +1065,7 @@
Adrian Sampson
James Sanders
Ilya Sandler
+Rafael Santos
Mark Sapiro
Ty Sarna
Hugh Sasse
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -940,6 +940,9 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list