Python test.test_support.run_unittest() Examples

The following are 30 code examples of test.test_support.run_unittest(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module test.test_support , or try the search function .
Example #1
Source File: test_rlcompleter.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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)) 
Example #2
Source File: test_urllib.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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,
        ) 
Example #3
Source File: test_peepholer.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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 
Example #4
Source File: test_socket.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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) 
Example #5
Source File: test_functools.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
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 
Example #6
Source File: test_cpickle.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_main():
    test_support.run_unittest(
        cPickleTests,
        cStringIOCUnpicklerTests,
        BytesIOCUnpicklerTests,
        FileIOCUnpicklerTests,
        cStringIOCPicklerTests,
        BytesIOCPicklerTests,
        FileIOCPicklerTests,
        cStringIOCPicklerListTests,
        BytesIOCPicklerListTests,
        FileIOCPicklerListTests,
        cStringIOCPicklerFastTests,
        BytesIOCPicklerFastTests,
        FileIOCPicklerFastTests,
        cPickleDeepRecursive,
        cPicklePicklerUnpicklerObjectTests,
        cPickleBigmemPickleTests,
    ) 
Example #7
Source File: test_binop.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(RatTestCase) 
Example #8
Source File: test_unicode.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(__name__) 
Example #9
Source File: test_atexit.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(TestCase) 
Example #10
Source File: test_tools.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(*[obj for obj in globals().values()
                                    if isinstance(obj, type)]) 
Example #11
Source File: test_enumerate.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main(verbose=None):
    test_support.run_unittest(__name__)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(__name__)
            counts[i] = sys.gettotalrefcount()
        print counts 
Example #12
Source File: test_httplib.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main(verbose=None):
    test_support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
                              HTTPTest, HTTPSTest, SourceAddressTest,
                              TunnelTests) 
Example #13
Source File: test_time.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(TimeTestCase) 
Example #14
Source File: test_collections.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main(verbose=None):
    NamedTupleDocs = doctest.DocTestSuite(module=collections)
    test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
                    TestCollectionABCs, TestCounter]
    test_support.run_unittest(*test_classes)
    test_support.run_doctest(collections, verbose) 
Example #15
Source File: test_extcall.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_doctest(sys.modules[__name__], True)
    test_support.run_unittest(ExtCallTest) 
Example #16
Source File: test_filecmp.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(FileCompareTestCase, DirCompareTestCase) 
Example #17
Source File: test_codecencodings_hk.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(__name__) 
Example #18
Source File: test_nntplib.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main(verbose=None):
    test_support.run_unittest(EvilServerTests)
    test_support.run_unittest(ServerTests) 
Example #19
Source File: test_univnewlines2k.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(
        TestNativeNewlines,
        TestCRNewlines,
        TestLFNewlines,
        TestCRLFNewlines,
        TestMixedNewlines
     ) 
Example #20
Source File: test_htmlparser.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(HTMLParserTestCase, AttributesTestCase) 
Example #21
Source File: test_sys_settrace.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(
        TraceTestCase,
        RaisingTraceFuncTestCase,
        JumpTestCase
    ) 
Example #22
Source File: test_class.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    with test_support.check_py3k_warnings(
            (".+__(get|set|del)slice__ has been removed", DeprecationWarning),
            ("classic int division", DeprecationWarning),
            ("<> not supported", DeprecationWarning)):
        test_support.run_unittest(ClassTests) 
Example #23
Source File: test_decorators.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(TestDecorators)
    test_support.run_unittest(TestClassDecorators) 
Example #24
Source File: test_email.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(suite())
    test_support.run_unittest(suite2()) 
Example #25
Source File: test_spwd.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(TestSpwdRoot) 
Example #26
Source File: test_modulefinder.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    distutils.log.set_threshold(distutils.log.WARN)
    test_support.run_unittest(ModuleFinderTest) 
Example #27
Source File: test_userdict.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    test_support.run_unittest(
        UserDictTest,
        UserDictMixinTest
    ) 
Example #28
Source File: test_urllib2_localnet.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    # We will NOT depend on the network resource flag
    # (Lib/test/regrtest.py -u network) since all tests here are only
    # localhost.  However, if this is a bad rationale, then uncomment
    # the next line.
    #test_support.requires("network")

    test_support.run_unittest(BasicAuthTests, ProxyAuthTests, TestUrlopen) 
Example #29
Source File: test_contextlib.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    with test_support.check_warnings(("With-statements now directly support "
                                      "multiple context managers",
                                      DeprecationWarning)):
        test_support.run_unittest(__name__) 
Example #30
Source File: test_gzip.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main(verbose=None):
    test_support.run_unittest(TestGzip)