本文整理汇总了Python中pypet.tests.testutils.ioutils.run_suite函数的典型用法代码示例。如果您正苦于以下问题:Python run_suite函数的具体用法?Python run_suite怎么用?Python run_suite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run_suite函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test
def test(folder=None, remove=True, predicate=None):
"""Runs all pypet tests
:param folder:
Temporary folder to put data in, leave `None` for
automatic choice.
:param remove:
If temporary data should be removed after the tests.
:param predicate:
Predicate to specify subset of tests. Must take three arguments
``class_name``, ``test_name``, ``tags`` and evaluate to `True` if
a test should be run. Leave `None` for all tests.
"""
if predicate is None:
predicate = lambda class_name, test_name, tags: class_name != TEST_IMPORT_ERROR
suite = discover_tests(predicate=predicate)
run_suite(suite=suite, remove=remove, folder=folder)
开发者ID:MehmetTimur,项目名称:pypet,代码行数:24,代码来源:pypettest.py
示例2: discover_tests
__author__ = 'robert'
try:
import pypet
except ImportError:
import sys
sys.path.append('/media/data/PYTHON_WORKSPACE/pypet-project')
import scoop
from pypet.tests.testutils.ioutils import discover_tests, parse_args, run_suite
from pypet.tests.integration.environment_scoop_test import check_mock
scoop_suite = discover_tests(lambda class_name, test_name, tags: 'scoop' in tags)
if __name__ == '__main__':
mock = check_mock()
if mock:
raise RuntimeError('Not running in SCOOP mode!')
opt_dict = parse_args()
run_suite(suite=scoop_suite, **opt_dict)
开发者ID:MehmetTimur,项目名称:pypet,代码行数:22,代码来源:scoop_run.py
示例3: LockerClient
self.create_file(filename)
self.start_server(url)
lock = LockerClient(url)
lock.start()
iterator = [(irun, lock, filename) for irun in range(self.ITERATIONS)]
list(futures.map(the_job, iterator))
lock.send_done()
self.check_file(filename)
self.lock_process.join()
# errwrite(str(irun))
self.ITERATIONS = old_iter
def test_timout_pool(self):
pool = mp.Pool(5)
url = get_random_port_url()
self.start_timeout_server(url, 0.25)
lock = LockerClient(url)
lock.start()
iterator = [(irun, lock) for irun in range(self.ITERATIONS)]
potential_timeouts = list(pool.imap(time_out_job, iterator))
pool.close()
pool.join()
all_time_outs = [x for x in potential_timeouts if x]
self.assertGreaterEqual(len(all_time_outs), 1)
lock.send_done()
self.lock_process.join()
if __name__ == '__main__':
opt_args = parse_args()
run_suite(**opt_args)
开发者ID:MehmetTimur,项目名称:pypet,代码行数:30,代码来源:mpwrappers_test.py
示例4: coverage_multiprocessing_process
return Process_WithCoverage
ProcessCoverage = coverage_multiprocessing_process()
if ProcessCoverage:
multiprocessing.Process = ProcessCoverage
print('Added Monkey-Patch for multiprocessing and code-coverage')
import sys
import os
pypetpath=os.path.abspath(os.getcwd())
sys.path.append(pypetpath)
print('Appended path `%s`' % pypetpath)
from pypet.tests.testutils.ioutils import run_suite, discover_tests, TEST_IMPORT_ERROR, parse_args
if __name__ == '__main__':
opt_dict = parse_args()
tests_include = set(('TestMPImmediatePostProc',
'MultiprocFrozenPoolSortQueueTest',
'MultiprocLinkNoPoolLockTest',
'MultiprocLinkNoPoolQueueTest',
'MultiprocLinkQueueTest',
'CapTest'))
pred = lambda class_name, test_name, tags: (class_name in tests_include or
'multiproc' not in tags)
suite = discover_tests(pred)
run_suite(suite=suite, **opt_dict)
开发者ID:henribunting,项目名称:pypet,代码行数:30,代码来源:coverage_run.py
示例5: discover_tests
__author__ = 'Robert Meyer'
from pypet.tests.testutils.ioutils import run_suite, discover_tests, TEST_IMPORT_ERROR
if __name__ == '__main__':
suite = discover_tests(predicate= lambda class_name, test_name, tags:
class_name != TEST_IMPORT_ERROR)
run_suite(remove=False, folder=None, suite=suite)
开发者ID:MehmetTimur,项目名称:pypet,代码行数:8,代码来源:_atworema.py
注:本文中的pypet.tests.testutils.ioutils.run_suite函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论