Commit 90a56376 authored by Fred Drake's avatar Fred Drake

Skip the tests that require an XML parser if TAL.tests.utils.skipxml is set.

parent 6750ac25
......@@ -98,6 +98,7 @@ if __name__ == "__main__":
import setpath # Local hack to tweak sys.path etc.
import driver
import tests.utils
def showdiff(a, b):
import ndiff
......@@ -133,8 +134,11 @@ def main():
del args[0]
if not args:
prefix = os.path.join("tests", "input", "test*.")
xmlargs = glob.glob(prefix + "xml")
xmlargs.sort()
if tests.utils.skipxml:
xmlargs = []
else:
xmlargs = glob.glob(prefix + "xml")
xmlargs.sort()
htmlargs = glob.glob(prefix + "html")
htmlargs.sort()
args = xmlargs + htmlargs
......@@ -149,6 +153,9 @@ def main():
if not unittesting:
print arg,
sys.stdout.flush()
if tests.utils.skipxml and arg[-4:] == ".xml":
print "SKIPPED (XML parser not available)"
continue
save = sys.stdout, sys.argv
try:
try:
......
......@@ -6,7 +6,6 @@ import utils
import unittest
import test_htmlparser
import test_htmltalparser
import test_xmlparser
import test_talinterpreter
import test_files
......@@ -14,7 +13,9 @@ def test_suite():
suite = unittest.TestSuite()
suite.addTest(test_htmlparser.test_suite())
suite.addTest(test_htmltalparser.test_suite())
suite.addTest(test_xmlparser.test_suite())
if not utils.skipxml:
import test_xmlparser
suite.addTest(test_xmlparser.test_suite())
suite.addTest(test_talinterpreter.test_suite())
suite.addTest(test_files.test_suite())
return suite
......
......@@ -47,8 +47,11 @@ def test_suite():
dir = os.path.abspath(dir)
parentdir = os.path.dirname(dir)
prefix = os.path.join(dir, "input", "test*.")
xmlargs = glob.glob(prefix + "xml")
xmlargs.sort()
if utils.skipxml:
xmlargs = []
else:
xmlargs = glob.glob(prefix + "xml")
xmlargs.sort()
htmlargs = glob.glob(prefix + "html")
htmlargs.sort()
args = xmlargs + htmlargs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment