本文整理汇总了Python中smanstal.tests.addtest函数的典型用法代码示例。如果您正苦于以下问题:Python addtest函数的具体用法?Python addtest怎么用?Python addtest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addtest函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(self): # {{{
pass
# End def #}}}
def testSetZero(self): # {{{
"""Setting to zero deletes"""
a = multiset((10, 20, 30))
a[10] = 0
expected = set({20: 1, 30: 1}.items())
self.assertEqual(set(a.items()), expected)
# End def #}}}
def testBadNegative(self): # {{{
"""Cannot set negative values"""
a = multiset([20])
msg = re.compile("Negative element counts are invalid: -100")
self.assertRaisesEx(ValueError, a.__setitem__, 20, -100, exc_pattern=msg)
# End def #}}}
# End class #}}}
# Create suite function for this module
suite = addtest(mksuite(__file__))
if __name__ == "__main__":
unittest.TextTestRunner(verbosity=2).run(suite())
示例2: Copyright
# Module: template
# File: template.py
# Copyright (C) 2006 Ariel De Ocampo [email protected]
#
# This module is part of the <WHAT-HAVE-YOU> project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import unittest
from smanstal.tests import addtest, mkdocsuite
# All tests go here
from os.path import abspath, sep, join as joinpath
apidocdir = joinpath(sep.join(abspath(__file__).split(sep)[:-3]), 'docs', 'manual')
# Create suite function for this module
suite = addtest(mkdocsuite(apidocdir, recurse=True))
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())
示例3: Copyright
# Module: template
# File: template.py
# Copyright (C) 2006 Ariel De Ocampo [email protected]
#
# This module is part of the <WHAT-HAVE-YOU> project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import unittest
from smanstal.tests import addtest, mkdocsuite
# All tests go here
from os.path import abspath, sep, join as joinpath
testdir = joinpath(sep.join(abspath(__file__).split(sep)[:-3]), 'tests', 'doc')
# Create suite function for this module
suite = addtest(mkdocsuite(testdir, recurse=True))
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())
示例4: __import__
continue
sysmod['/%s/_private/%s' %(basepackage, '/'.join(p))] = __import__(name)
sysmod.pop(name, None)
sys.path = oldpath
# End def #}}}
# Create suite function for this package
#suite = addtest(__file__)(mksuite(__file__))
def init(): #{{{
basedir = abspath(__file__)
basedir = join(sep, *dirname(basedir).split(sep)[1:-1])
global basepackage
if not basepackage:
basepackage = basename(basedir)
set_private_packages(basedir)
# End def #}}}
if __name__ == '__main__':
# Set up environment
init()
alltests = __import__('/%s/_private/tests/alltests' %basepackage)
python = __import__('/%s/_private/util/python' %basepackage)
app_version = __import__('/%s/_private/util/python.version' %basepackage)
alltests = alltests.__file__
suite = addtest(alltests)(mksuite(alltests))
# Run the tests
unittest.TextTestRunner(verbosity=2).run(suite())
示例5: Copyright
# Module: template
# File: template.py
# Copyright (C) 2006 Ariel De Ocampo [email protected]
#
# This module is part of the <WHAT-HAVE-YOU> project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import unittest
from smanstal.tests import addtest, mkdocsuite
# All tests go here
from os.path import abspath, sep, join as joinpath
manualdocdir = joinpath(sep.join(abspath(__file__).split(sep)[:-3]), 'doc', 'manual')
# Create suite function for this module
suite = addtest(mkdocsuite(manualdocdir, recurse=True))
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())