当前位置: 首页>>代码示例>>Python>>正文


Python tests.addtest函数代码示例

本文整理汇总了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())
开发者ID:BackupTheBerlios,项目名称:empath-svn,代码行数:30,代码来源:TestMagic_setitem.py

示例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())

开发者ID:BackupTheBerlios,项目名称:empath-svn,代码行数:19,代码来源:TestDocTests.py

示例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())

开发者ID:BackupTheBerlios,项目名称:empath-svn,代码行数:19,代码来源:TestDocTests.py

示例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())
开发者ID:BackupTheBerlios,项目名称:empath-svn,代码行数:30,代码来源:runtests.py

示例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())

开发者ID:BackupTheBerlios,项目名称:empath-svn,代码行数:19,代码来源:TestManual.py


注:本文中的smanstal.tests.addtest函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。