當前位置: 首頁>>代碼示例>>Python>>正文


Python test_support.run_unittest方法代碼示例

本文整理匯總了Python中test.test_support.run_unittest方法的典型用法代碼示例。如果您正苦於以下問題:Python test_support.run_unittest方法的具體用法?Python test_support.run_unittest怎麽用?Python test_support.run_unittest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在test.test_support的用法示例。


在下文中一共展示了test_support.run_unittest方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
             TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest,
             UDPTimeoutTest ]

    tests.extend([
        NonBlockingTCPTests,
        FileObjectClassTestCase,
        FileObjectInterruptedTestCase,
        UnbufferedFileObjectClassTestCase,
        LineBufferedFileObjectClassTestCase,
        SmallBufferedFileObjectClassTestCase,
        Urllib2FileobjectTest,
        NetworkConnectionNoServer,
        NetworkConnectionAttributesTest,
        NetworkConnectionBehaviourTest,
    ])
    tests.append(BasicSocketPairTest)
    tests.append(TestLinuxAbstractNamespace)
    tests.extend([TIPCTest, TIPCThreadableTest])

    thread_info = test_support.threading_setup()
    test_support.run_unittest(*tests)
    test_support.threading_cleanup(*thread_info) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:26,代碼來源:test_socket.py

示例2: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main(verbose=None):
    test_classes = (
        TestPartial,
        TestPartialSubclass,
        TestPythonPartial,
        TestUpdateWrapper,
        TestTotalOrdering,
        TestWraps,
        TestReduce,
    )
    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 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:23,代碼來源:test_functools.py

示例3: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    import warnings
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', ".*urllib\.urlopen.*Python 3.0",
                                DeprecationWarning)
        test_support.run_unittest(
            urlopen_FileTests,
            urlopen_HttpTests,
            urlretrieve_FileTests,
            urlretrieve_HttpTests,
            ProxyTests,
            QuotingTests,
            UnquotingTests,
            urlencode_Tests,
            Pathname_Tests,
            Utility_Tests,
            URLopener_Tests,
            ProxyTests,
            ProxyTests_withOrderedEnv,
            #FTPWrapperTests,
        ) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:23,代碼來源:test_urllib.py

示例4: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    support.run_unittest(TestRlcompleter)

    def test_duplicate_globals(self):
        namespace = {
            'False': None,  # Keyword vs builtin vs namespace
            'assert': None,  # Keyword vs namespace
            'try': lambda: None,  # Keyword vs callable
            'memoryview': None,  # Callable builtin vs non-callable
            'Ellipsis': lambda: None,  # Non-callable builtin vs callable
        }
        completer = rlcompleter.Completer(namespace)
        self.assertEqual(completer.complete('False', 0), 'False')
        self.assertIsNone(completer.complete('False', 1))  # No duplicates
        self.assertEqual(completer.complete('assert', 0), 'assert')
        self.assertIsNone(completer.complete('assert', 1))
        self.assertEqual(completer.complete('try', 0), 'try')
        self.assertIsNone(completer.complete('try', 1))
        # No opening bracket "(" because we overrode the built-in class
        self.assertEqual(completer.complete('memoryview', 0), 'memoryview')
        self.assertIsNone(completer.complete('memoryview', 1))
        self.assertEqual(completer.complete('Ellipsis', 0), 'Ellipsis(')
        self.assertIsNone(completer.complete('Ellipsis', 1)) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:25,代碼來源:test_rlcompleter.py

示例5: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(
        cPickleTests,
        cStringIOCUnpicklerTests,
        BytesIOCUnpicklerTests,
        FileIOCUnpicklerTests,
        cStringIOCPicklerTests,
        BytesIOCPicklerTests,
        FileIOCPicklerTests,
        cStringIOCPicklerListTests,
        BytesIOCPicklerListTests,
        FileIOCPicklerListTests,
        cStringIOCPicklerFastTests,
        BytesIOCPicklerFastTests,
        FileIOCPicklerFastTests,
        cPickleDeepRecursive,
        cPicklePicklerUnpicklerObjectTests,
        cPickleBigmemPickleTests,
    ) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:21,代碼來源:test_cpickle.py

示例6: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main(verbose=None):
    import sys
    from test import test_support
    test_classes = (TestTranforms,)

    with test_support.check_py3k_warnings(
            ("backquote not supported", SyntaxWarning)):
        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 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:20,代碼來源:test_peepholer.py

示例7: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(
        ZoneFileTests
    ) 
開發者ID:blockstack,項目名稱:zone-file-py,代碼行數:6,代碼來源:unit_tests.py

示例8: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    support.run_unittest(CBufferSizeTest, PyBufferSizeTest, BuiltinBufferSizeTest) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_bufio.py

示例9: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    with test_support.check_py3k_warnings(
            ("tuple parameter unpacking has been removed", SyntaxWarning),
            ("parenthesized argument names are invalid", SyntaxWarning)):
        test_support.run_unittest(ComplexArgsTestCase) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:7,代碼來源:test_complex_args.py

示例10: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    with test_support.check_py3k_warnings(("buffer.. not supported",
                                           DeprecationWarning)):
        test_support.run_unittest(BufferTests) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:6,代碼來源:test_buffer.py

示例11: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_ttk'])) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:6,代碼來源:test_ttk_guionly.py

示例12: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(PopenTest) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_popen.py

示例13: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(FnmatchTestCase, TranslateTestCase, FilterTestCase) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_fnmatch.py

示例14: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(TestPrint) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_print.py

示例15: test_main

# 需要導入模塊: from test import test_support [as 別名]
# 或者: from test.test_support import run_unittest [as 別名]
def test_main():
    test_support.run_unittest(NetrcTestCase) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:4,代碼來源:test_netrc.py


注:本文中的test.test_support.run_unittest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。