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


Python mpiunittest.main函数代码示例

本文整理汇总了Python中mpiunittest.main函数的典型用法代码示例。如果您正苦于以下问题:Python main函数的具体用法?Python main怎么用?Python main使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了main函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: runtestsleak

def runtestsleak(repeats, *args, **kargs):
    import gc
    test = r1 = r2 = None
    while repeats:
        repeats -= 1
        gc.collect()
        r1 = sys.gettotalrefcount()
        for test in alltests:
            mpiunittest.main(test, *args, **kargs)
        gc.collect()
        r2 = sys.gettotalrefcount()
        sys.stderr.flush()
        sys.stderr.write('\nREF LEAKS -- before: %d, after: %d, diff: [%d]\n' % (r1, r2, r2-r1))
        sys.stderr.flush()
开发者ID:datawrangling,项目名称:mpi4py,代码行数:14,代码来源:runalltest.py

示例2: testJson

            self.do_pickle(obj, pickle)
        self.do_pickle(OBJS2, pickle)

    @unittest.skipIf(json is None, 'json')
    def testJson(self):
        pickle = self.pickle
        dumps = lambda o: json.dumps(o).encode()
        loads = lambda s: json.loads(tobytes(s).decode())
        pickle.__init__(dumps, loads)
        OBJS2 = [o for o in OBJS
                 if not isinstance(o, (float, complex, tuple))]
        for obj in OBJS2:
            self.do_pickle(obj, pickle)
        self.do_pickle(OBJS2, pickle)

    @unittest.skipIf(yaml is None, 'yaml')
    def testYAML(self):
        pickle = self.pickle
        dumps = lambda o: yaml.dump(o).encode()
        loads = lambda s: yaml.load(tobytes(s).decode())
        pickle.__init__(dumps, loads)
        OBJS2 = [o for o in OBJS
                 if not isinstance(o, (complex, tuple))]
        for obj in OBJS2:
            self.do_pickle(obj, pickle)
        self.do_pickle(OBJS2, pickle)


if __name__ == '__main__':
    unittest.main()
开发者ID:benkirk,项目名称:mpi_playground,代码行数:30,代码来源:test_pickle.py

示例3: runtests

def runtests(*args, **kargs):
    for test in alltests:
        sys.stderr.flush()
        sys.stderr.write("\nRunning %s\n" % test.__name__)
        sys.stderr.flush()
        mpiunittest.main(test, *args, **kargs)
开发者ID:datawrangling,项目名称:mpi4py,代码行数:6,代码来源:runalltest.py


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