• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python tests.addtest函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tests.mksuite函数代码示例发布时间:2022-05-27
下一篇:
Python smach_ros.IntrospectionServer类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap