本文整理汇总了Python中nose2.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: Test
import nose2
import unittest
import logging
log = logging.getLogger(__name__)
class Test(unittest.TestCase):
def test_logging_config(self):
log.debug("foo")
log.info("bar")
assert False
if __name__ == '__main__':
nose2.main()
开发者ID:nose-devs,项目名称:nose2,代码行数:17,代码来源:logging_config.py
示例2: aubio_cmd
import aubio.cmd
from nose2 import main
from numpy.testing import TestCase
class aubio_cmd(TestCase):
def setUp(self):
self.a_parser = aubio.cmd.aubio_parser()
def test_default_creation(self):
try:
assert self.a_parser.parse_args(['-V']).show_version
except SystemExit:
url = 'https://bugs.python.org/issue9253'
self.skipTest('subcommand became optional in py3, see %s' % url)
class aubio_cmd_utils(TestCase):
def test_samples2seconds(self):
self.assertEqual(aubio.cmd.samples2seconds(3200, 32000), "0.100000\t")
def test_samples2milliseconds(self):
self.assertEqual(aubio.cmd.samples2milliseconds(3200, 32000), "100.000000\t")
def test_samples2samples(self):
self.assertEqual(aubio.cmd.samples2samples(3200, 32000), "3200\t")
if __name__ == '__main__':
main()
开发者ID:anthonylauzon,项目名称:aubio,代码行数:29,代码来源:test_aubio_cmd.py
示例3: test_cache_expiration
def test_cache_expiration(self):
from qualysapi import api_objects
mymap = api_objects.Map(
name = 'Bogus Test Map',
ref = 'map/12345.bogus',
date = '2015-11-19T06:00:39Z',
status = 'Finished',
report_id = None,
)
self.cache_instance.cache_api_object(obj=mymap, expiration=1)
# sleep for 2 seconds, letting the cache expire the key after 1
import time
time.sleep(2)
fromcache = self.cache_instance.load_api_object(
objkey = mymap.getKey(),
objtype = api_objects.Map
)
self.assertIsNone(fromcache)
def test_speed(self):
self.assertTrue(False)
#stand-alone test execution
if __name__ == '__main__':
import nose2
nose2.main(argv=['fake', '--log-capture'])
开发者ID:SkyLeach,项目名称:qualysapi,代码行数:28,代码来源:test_qualys_cache.py
示例4: run_from_argv
def run_from_argv(self, argv):
import nose2
with run_tests():
nose2.main(module=None, argv=argv[1:])
开发者ID:naskoro,项目名称:djtest-bootstrap,代码行数:5,代码来源:nose2.py
注:本文中的nose2.main函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论