本文整理汇总了Python中unittest.TestSuite类的典型用法代码示例。如果您正苦于以下问题:Python TestSuite类的具体用法?Python TestSuite怎么用?Python TestSuite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestSuite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_suite
def build_suite(self, test_labels, extra_tests=None, **kwargs):
'''
Override the base class method to return a suite consisting of all
TestCase subclasses throughought the whole project.
'''
if test_labels:
suite = TestSuite()
else:
suite = DjangoTestSuiteRunner.build_suite(
self, test_labels, extra_tests, **kwargs
)
added_test_classes = set(t.__class__ for t in suite)
loader = TestLoader()
for fname in _get_module_names(os.getcwd()):
module = _import(_to_importable_name(fname))
for test_class in _get_testcases(module):
if test_class in added_test_classes:
continue
for method_name in loader.getTestCaseNames(test_class):
testname = '.'.join([
module.__name__, test_class.__name__, method_name
])
if self._test_matches(testname, test_labels):
suite.addTest(loader.loadTestsFromName(testname))
added_test_classes.add(test_class)
return reorder_suite(suite, (TestCase,))
示例2: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestTutorialPageComments))
if MockMailHost:
suite.addTest(makeSuite(MockMailHostTests))
return suite
示例3: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestSSOLogin))
suite.addTest(makeSuite(TestSSOLoginIframe))
return suite
示例4: test_suite
def test_suite():
suite = TestSuite()
suite.addTest(wkt.test_suite())
suite.addTest(kml.test_suite())
suite.addTest(gpx.test_suite())
suite.addTest(csv.test_suite())
return suite
示例5: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
# Add our test class here - you can add more test classes if you wish,
# and they will be run together.
suite.addTest(makeSuite(TestTemplateCreation))
return suite
示例6: additional_tests
def additional_tests():
proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
readme_fn = os.path.join(proj_dir, 'README.txt')
suite = TestSuite([doctest.DocTestSuite('pybloom.pybloom')])
if os.path.exists(readme_fn):
suite.addTest(doctest.DocFileSuite(readme_fn, module_relative=False))
return suite
示例7: loadTestsFromName
def loadTestsFromName(self, name, module=None):
suite = TestSuite()
for test in findTests(name):
sys.path.insert(0, name) # python3 compatibility
suite.addTests(super(TestLoader, self).loadTestsFromName(test))
del sys.path[0] # python3 compatibility
return suite
示例8: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestCSSRegistry))
suite.addTest(makeSuite(TestJSRegistry))
return suite
示例9: test_suite
def test_suite():
suite = TestSuite()
import setsuden4trac.tests.reader
suite.addTest(makeSuite(setsuden4trac.tests.reader.ReaderTests))
import setsuden4trac.tests.core
suite.addTest(makeSuite(setsuden4trac.tests.core.ComponentTests))
return suite
示例10: suite
def suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(ModuleTests))
return suite
示例11: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
from Products.LinguaPlone.tests import LinguaPloneTestCase
LinguaPloneTestCase # PYFLAKES
suite.addTest(makeSuite(TestWeblogTranslation))
return suite
示例12: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestPortlet))
suite.addTest(makeSuite(TestRenderer))
return suite
示例13: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestHTTPHeaders))
return suite
示例14: test_suite
def test_suite():
from unittest import TestSuite, makeSuite
from Products.PloneTestCase.layer import ZCMLLayer
suite = TestSuite()
suite.layer = ZCMLLayer
suite.addTest(makeSuite(TestCustomScript))
return suite
示例15: test_suite
def test_suite():
""" Test suite
"""
from unittest import TestSuite, makeSuite
suite = TestSuite()
suite.addTest(makeSuite(TestSomething))
return suite