def test_main(): tests = [ GeneralModuleTests, TestSocketOptions, BasicTCPTest, TCPTimeoutTest, TCPClientTimeoutTest, TestExceptions, TestTCPAddressParameters, TestUDPAddressParameters, BasicUDPTest, UDPTimeoutTest, NonBlockingTCPTests, NonBlockingUDPTests, TCPFileObjectClassOpenCloseTests, UDPFileObjectClassOpenCloseTests, FileAndDupOpenCloseTests, FileObjectClassTestCase, PrivateFileObjectTestCase, UnbufferedFileObjectClassTestCase, LineBufferedFileObjectClassTestCase, SmallBufferedFileObjectClassTestCase, UnicodeTest ] if hasattr(socket, "socketpair"): tests.append(BasicSocketPairTest) if sys.platform[:4] == 'java': tests.append(TestJythonTCPExceptions) tests.append(TestJythonUDPExceptions) # TODO: Broadcast requires permission, and is blocked by some firewalls # Need some way to discover the network setup on the test machine if False: tests.append(UDPBroadcastTest) suites = [unittest.makeSuite(klass, 'test') for klass in tests] test_support.run_suite(unittest.TestSuite(suites))
def test_main(): l = [ unittest.makeSuite(RORowRefTestCase), unittest.makeSuite(RowRefTestCase), unittest.makeSuite(ViewerTestCase), unittest.makeSuite(ViewTestCase), ] suite = unittest.TestSuite(l) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_CP932)) suite.addTest(unittest.makeSuite(Test_EUC_JISX0213)) suite.addTest(unittest.makeSuite(Test_EUC_JP_COMPAT)) suite.addTest(unittest.makeSuite(Test_SJIS_COMPAT)) suite.addTest(unittest.makeSuite(Test_SJISX0213)) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_MultibyteCodec)) suite.addTest(unittest.makeSuite(Test_IncrementalEncoder)) suite.addTest(unittest.makeSuite(Test_IncrementalDecoder)) suite.addTest(unittest.makeSuite(Test_StreamWriter)) suite.addTest(unittest.makeSuite(Test_ISO2022)) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP932Map)) suite.addTest(unittest.makeSuite(TestEUCJPCOMPATMap)) suite.addTest(unittest.makeSuite(TestSJISCOMPATMap)) suite.addTest(unittest.makeSuite(TestEUCJISX0213Map)) suite.addTest(unittest.makeSuite(TestSJISX0213Map)) test_support.run_suite(suite)
def test_main(): import unittest try: from test.test_support import run_suite run_suite( unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]) ) except ImportError: unittest.main()
def test_main(): test_suite = unittest.TestSuite() test_loader = unittest.TestLoader() def suite_add(case): test_suite.addTest(test_loader.loadTestsFromTestCase(case)) suite_add(WeakIdentityMapTests) suite_add(LongAsScaledDoubleValueTests) suite_add(ExtraMathTests) suite_add(DatetimeTypeMappingTest) run_suite(test_suite)
def test_main(): tests = [ TestSelectInvalidParameters, TestSelectClientSocket, TestPollClientSocket, ThreadedPollClientSocket, ] if sys.platform[:4] != 'java': tests.append(TestPipes) suites = [unittest.makeSuite(klass, 'test') for klass in tests] test_support.run_suite(unittest.TestSuite(suites))
def test_main(): test_suite = unittest.TestSuite() test_loader = unittest.TestLoader() def suite_add(case): test_suite.addTest(test_loader.loadTestsFromTestCase(case)) suite_add(WeakIdentityMapTests) suite_add(LongAsScaledDoubleValueTests) suite_add(ExtraMathTests) suite_add(DatetimeTypeMappingTest) suite_add(IdTest) suite_add(FrameTest) suite_add(ModuleTest) suite_add(MemoryLeakTests) run_suite(test_suite)
def test_main(verbose=False): test_suite = unittest.TestSuite() test_loader = unittest.TestLoader() def suite_add(case): test_suite.addTest(test_loader.loadTestsFromTestCase(case)) for t in [ TestSetOfSets, TestExceptionPropagation, TestBasicOpsEmpty, TestBasicOpsSingleton, TestBasicOpsTuple, TestBasicOpsTriple, TestBinaryOps, TestUpdateOps, TestMutate, TestSubsetEqualEmpty, TestSubsetEqualNonEmpty, TestSubsetEmptyNonEmpty, TestSubsetPartial, TestSubsetNonOverlap, TestOnlySetsNumeric, TestOnlySetsDict, TestOnlySetsOperator, TestOnlySetsTuple, TestOnlySetsString, TestOnlySetsGenerator, TestCopyingEmpty, TestCopyingSingleton, TestCopyingTriple, TestCopyingTuple, TestCopyingNested, TestIdentities, ]: suite_add(t) _verbose = test_support.verbose try: test_support.verbose = False test_support.run_suite(test_suite) finally: test_support.verbose = _verbose
def test_main(): suite = DocTestSuite('_threading_local') try: from thread import _local except ImportError: pass else: import _threading_local local_orig = _threading_local.local def setUp(test): _threading_local.local = _local def tearDown(test): _threading_local.local = local_orig suite.addTest(DocTestSuite('_threading_local', setUp=setUp, tearDown=tearDown) ) test_support.run_suite(suite)
def test_main(): suite = test_email_codecs.suite() suite.addTest(test_email_codecs_renamed.suite()) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_Big5)) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_GB2312)) suite.addTest(unittest.makeSuite(Test_GBK)) suite.addTest(unittest.makeSuite(Test_GB18030)) test_support.run_suite(suite)
def test_main(): run_suite( unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]) )
def test_main(): import unittest from test.test_support import run_suite run_suite( unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]))
def test_main(): test_support.run_suite(tests) TestCase().run()
def test_main(): tests = [ UnicodeTests, ] suites = [unittest.makeSuite(klass, 'test') for klass in tests] test_support.run_suite(unittest.TestSuite(suites))
def test_main(): tests = suite() run_suite(tests)
def run_unittest(testclass): """Run tests from a unittest.TestCase-derived class.""" run_suite(unittest.makeSuite(testclass), testclass)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_StreamWriter)) suite.addTest(unittest.makeSuite(Test_ISO2022)) test_support.run_suite(suite)
def test_main(): skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0) suites = [unittest.makeSuite(t) for t in testcases] run_suite(unittest.TestSuite(suites))
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBIG5Map)) suite.addTest(unittest.makeSuite(TestCP950Map)) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_CP949)) suite.addTest(unittest.makeSuite(Test_EUCKR)) suite.addTest(unittest.makeSuite(Test_JOHAB)) test_support.run_suite(suite)
def test_main(): tests = [TestSelect, TestSelectOnAccept] suites = [unittest.makeSuite(klass, 'test') for klass in tests] test_support.run_suite(unittest.TestSuite(suites))
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_StreamWriter)) test_support.run_suite(suite)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestUnicodeFiles)) run_suite(suite)
def test_main(): test_support.run_suite(suite())
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestGB2312Map)) suite.addTest(unittest.makeSuite(TestGBKMap)) test_support.run_suite(suite)
# From bug report #523041 # 7. doc = """ User-Agent: * Disallow: /. """ good = ['/foo.html'] bad = [] # Bug report says "/" should be denied, but that is not in the RFC RobotTest(7, doc, good, bad) class TestCase(unittest.TestCase): def runTest(self): test_support.requires('network') # whole site is password-protected. url = 'http://mueblesmoraleda.com' parser = robotparser.RobotFileParser() parser.set_url(url) parser.read() self.assertEqual(parser.can_fetch("*", url+"/robots.txt"), False) def test_main(): test_support.run_suite(tests) TestCase().run() if __name__=='__main__': test_support.Verbose = 1 test_support.run_suite(tests)
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP949Map)) suite.addTest(unittest.makeSuite(TestEUCKRMap)) suite.addTest(unittest.makeSuite(TestJOHABMap)) test_support.run_suite(suite)
def test_main(): test_support.run_suite(test_email_codecs.suite())
"""PyUNIT-based compatibility module for the test.test_support module. When running PyUNIT-based tests, this should be used for the run_suite() and run_unittest() functions. """ from test.test_support import verbose, TestFailed try: from test.test_support import run_suite, run_unittest except ImportError: #======================================================================= # Preliminary PyUNIT integration. import sys import unittest class BasicTestRunner: def run(self, test): result = unittest.TestResult() test(result) return result def run_suite(suite, testclass=None): """Run tests from a unittest.TestSuite-derived class.""" if verbose: runner = unittest.TextTestRunner(sys.stdout, verbosity=2) else: runner = BasicTestRunner()
# # $Id: testall.py,v 1.3 2004/06/19 06:09:55 perky Exp $ import sys import os, unittest from test import test_support def findtests(testdir='.'): tests = [] for name in os.listdir(testdir): if (name.startswith('test_') and name.endswith('.py') and not name.endswith('support.py')): tests.append(name[:-3]) return tests def loadtests(test): mod = __import__(test, globals(), locals(), []) return unittest.findTestCases(mod) def main(): suite = unittest.TestSuite() for test in findtests(): try: suite.addTest(loadtests(test)) except test_support.TestSkipped, msg: print "%s - skipped: %s" % (test, msg) test_support.run_suite(suite) if __name__ == '__main__': main()
def test_main(): run_suite(suite())
def test_main(): import unittest from test.test_support import run_suite run_suite( unittest.defaultTestLoader.loadTestsFromModule(sys.modules[__name__]) )
doc = """ User-Agent: * Disallow: /. """ good = ['/foo.html'] bad = [] # Bug report says "/" should be denied, but that is not in the RFC RobotTest(7, doc, good, bad) class TestCase(unittest.TestCase): def runTest(self): test_support.requires('network') # whole site is password-protected. url = 'http://mueblesmoraleda.com' parser = robotparser.RobotFileParser() parser.set_url(url) parser.read() self.assertEqual(parser.can_fetch("*", url + "/robots.txt"), False) def test_main(): test_support.run_suite(tests) TestCase().run() if __name__ == '__main__': test_support.Verbose = 1 test_support.run_suite(tests)