def makeTestSuite():
import inspect
suite = TestSuite()
suite.addTest( PyparsingTestInit() )
test_case_classes = ParseTestCase.__subclasses__()
# put classes in order as they are listed in the source code
test_case_classes.sort(key=lambda cls: inspect.getsourcelines(cls)[1])
test_case_classes.remove(PyparsingTestInit)
# test_case_classes.remove(ParseASMLTest)
test_case_classes.remove(EnablePackratParsing)
if IRON_PYTHON_ENV:
test_case_classes.remove(OriginalTextForTest)
suite.addTests(T() for T in test_case_classes)
if TEST_USING_PACKRAT:
# retest using packrat parsing (disable those tests that aren't compatible)
suite.addTest( EnablePackratParsing() )
unpackrattables = [ PyparsingTestInit, EnablePackratParsing, RepeaterTest, ]
# add tests to test suite a second time, to run with packrat parsing
# (leaving out those that we know wont work with packrat)
packratTests = [t.__class__() for t in suite._tests
if t.__class__ not in unpackrattables]
suite.addTests( packratTests )
return suite
评论列表
文章目录