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


Python test_support.run_unittest函数代码示例

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


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

示例1: main

def main():
    test_support.run_unittest(LockTests, RLockTests, EventTests,
                                   ConditionAsRLockTests, ConditionTests,
                                   SemaphoreTests, BoundedSemaphoreTests,
                                   ThreadTests,
                                   ThreadJoinOnShutdown,
                                   ThreadingExceptionTests,
                                   )
开发者ID:dustyneuron,项目名称:gevent,代码行数:8,代码来源:test_threading_2.py

示例2: test_main

def test_main(verbose=None):
    NamedTupleDocs = doctest.DocTestSuite(module=collections)
    test_classes = [
        TestNamedTuple,
        NamedTupleDocs,
        TestOneTrickPonyABCs,
        TestCollectionABCs,
        TestCounter,
        TestOrderedDict,
        GeneralMappingTests,
        SubclassMappingTests,
    ]
    test_support.run_unittest(*test_classes)
    test_support.run_doctest(collections, verbose)
开发者ID:gward,项目名称:backport_collections,代码行数:14,代码来源:test_collections.py

示例3: test_main

def test_main(verbose=None):
    import sys

    test_classes = (TestBasic, TestVariousIteratorArgs, TestSubclass, TestSubclassWithKwargs)

    test_support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc

        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts

    # doctests
    import test_deque

    test_support.run_doctest(test_deque, verbose)
开发者ID:gward,项目名称:backport_collections,代码行数:22,代码来源:test_deque.py

示例4: test_main

def test_main():
    import sys
    test_support.run_unittest(TestSubclasses)
开发者ID:BackupTheBerlios,项目名称:etpe-svn,代码行数:3,代码来源:test_subclasses.py

示例5: test_main

def test_main():
    test_support.run_unittest(MessageTestCase)
开发者ID:Bail-jw,项目名称:mediacomp-jes,代码行数:2,代码来源:test_rfc822.py

示例6: test_main

def test_main():
    test_support.run_unittest(ImportHooksTestCase)
开发者ID:denis-vilyuzhanin,项目名称:OpenModelSphereMirror,代码行数:2,代码来源:test_importhooks.py

示例7: test_main

def test_main():
    test_support.run_unittest(QueueTest, LifoQueueTest, PriorityQueueTest,
                              FailingQueueTest)
开发者ID:SMFOSS,项目名称:gevent,代码行数:3,代码来源:test_queue.py

示例8: test_main

def test_main():
    run_unittest(CommandTests)
开发者ID:denis-vilyuzhanin,项目名称:OpenModelSphereMirror,代码行数:2,代码来源:test_commands.py

示例9: trace

            old = None
        lst = []
        try:
            def trace(frame, ev, arg):
                lst.append((frame.f_code.co_filename, frame.f_lineno, ev))
                six.print_("TRACE: %s:%s %s" % lst[-1])
                return trace

            with gevent.thread.allocate_lock():
                sys.settrace(trace)
        finally:
            sys.settrace(old)

        self.failUnless(lst == [], "trace not empty")

    def run_script(self, more_args=[]):
        rc = subprocess.call([sys.executable, "-c", script] + more_args)
        self.failIf(rc == 2, "interpreter was blocked")
        self.failUnless(rc == 0, "Unexpected error")

    def test_finalize_with_trace(self):
        self.run_script()

    def test_bootstrap_inner_with_trace(self):
        self.run_script(["1"])


if __name__ == "__main__":
    import test_support
    test_support.run_unittest(ThreadTrace)
开发者ID:dustyneuron,项目名称:gevent,代码行数:30,代码来源:test__threading_vs_settrace.py

示例10: test_main

def test_main():
    test_support.run_unittest(JreloadTestCase)
开发者ID:denis-vilyuzhanin,项目名称:OpenModelSphereMirror,代码行数:2,代码来源:test_jreload.py

示例11: test_main

def test_main():
    run_unittest(CodeopTests)
开发者ID:BackupTheBerlios,项目名称:etpe-svn,代码行数:2,代码来源:test_codeop.py

示例12: testall

def testall():
    test_support.run_unittest(Test)
开发者ID:SMFOSS,项目名称:gevent,代码行数:2,代码来源:test_socketserver.py

示例13: test_main

def test_main():
    run_unittest(GlobTests)
开发者ID:denis-vilyuzhanin,项目名称:OpenModelSphereMirror,代码行数:2,代码来源:test_glob.py

示例14: NetrcTestCase

default login log2 password pass2 

"""

temp_filename = tempfile.mktemp()

class NetrcTestCase(unittest.TestCase):

    def setUp (self):
        fp = open(temp_filename, 'wt')
        fp.write(TEST_NETRC)
        fp.close()
        self.netrc = netrc.netrc(temp_filename)
        
    def tearDown (self):
        del self.netrc
        os.unlink(temp_filename)

    def test_case_1(self):
        self.assert_(self.netrc.macros == {'macro1':['line1\n', 'line2\n'],
                                           'macro2':['line3\n', 'line4\n']}
                                           )
        self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1'))
        self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2'))
            
        
if __name__ == "__main__":
    test_support.run_unittest(NetrcTestCase)

开发者ID:mancoast,项目名称:CPythonPyc_test,代码行数:28,代码来源:221_test_netrc.py

示例15: test_main

def test_main():
    run_unittest(MhlibTests)
开发者ID:doom38,项目名称:jython_v2.2.1,代码行数:2,代码来源:223_test_mhlib.py


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