Python unittest.makeSuite() Examples

The following are 30 code examples of unittest.makeSuite(). 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 unittest , or try the search function .
Example #1
Source File: tests.py    From pywren-ibm-cloud with Apache License 2.0 10 votes vote down vote up
def run_tests(test_to_run, config=None):
    global CONFIG, STORAGE_CONFIG, STORAGE

    CONFIG = json.load(args.config) if config else default_config()
    STORAGE_CONFIG = extract_storage_config(CONFIG)
    STORAGE = InternalStorage(STORAGE_CONFIG).storage_handler

    suite = unittest.TestSuite()
    if test_to_run == 'all':
        suite.addTest(unittest.makeSuite(TestPywren))
    else:
        try:
            suite.addTest(TestPywren(test_to_run))
        except ValueError:
            print("unknown test, use: --help")
            sys.exit()

    runner = unittest.TextTestRunner()
    runner.run(suite) 
Example #2
Source File: test_replication.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()
    if db.version() >= (4, 6) :
        dbenv = db.DBEnv()
        try :
            dbenv.repmgr_get_ack_policy()
            ReplicationManager_available=True
        except :
            ReplicationManager_available=False
        dbenv.close()
        del dbenv
        if ReplicationManager_available :
            suite.addTest(unittest.makeSuite(DBReplicationManager))

        if have_threads :
            suite.addTest(unittest.makeSuite(DBBaseReplication))

    return suite 
Example #3
Source File: test_thread.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()

    if have_threads:
        suite.addTest(unittest.makeSuite(BTreeConcurrentDataStore))
        suite.addTest(unittest.makeSuite(HashConcurrentDataStore))
        suite.addTest(unittest.makeSuite(BTreeSimpleThreaded))
        suite.addTest(unittest.makeSuite(HashSimpleThreaded))
        suite.addTest(unittest.makeSuite(BTreeThreadedTransactions))
        suite.addTest(unittest.makeSuite(HashThreadedTransactions))
        suite.addTest(unittest.makeSuite(BTreeThreadedNoWaitTransactions))
        suite.addTest(unittest.makeSuite(HashThreadedNoWaitTransactions))

    else:
        print "Threads not available, skipping thread tests."

    return suite 
Example #4
Source File: test_associate.py    From ironpython2 with Apache License 2.0 6 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()

    suite.addTest(unittest.makeSuite(AssociateErrorTestCase))

    suite.addTest(unittest.makeSuite(AssociateHashTestCase))
    suite.addTest(unittest.makeSuite(AssociateBTreeTestCase))
    suite.addTest(unittest.makeSuite(AssociateRecnoTestCase))

    suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))

    suite.addTest(unittest.makeSuite(ShelveAssociateHashTestCase))
    suite.addTest(unittest.makeSuite(ShelveAssociateBTreeTestCase))
    suite.addTest(unittest.makeSuite(ShelveAssociateRecnoTestCase))

    if have_threads:
        suite.addTest(unittest.makeSuite(ThreadedAssociateHashTestCase))
        suite.addTest(unittest.makeSuite(ThreadedAssociateBTreeTestCase))
        suite.addTest(unittest.makeSuite(ThreadedAssociateRecnoTestCase))

    return suite 
Example #5
Source File: test.py    From pandoc-xnos with GNU General Public License v3.0 6 votes vote down vote up
def main():
    """Runs the suite of unit tests"""

    # Do the tests
    suite = unittest.TestSuite()
    suite.addTests(unittest.makeSuite(TestXnos))
    suite.addTests(unittest.makeSuite(TestPandocAttributes))
    result = unittest.TextTestRunner(verbosity=1).run(suite)
    n_errors = len(result.errors)
    n_failures = len(result.failures)

    if n_errors or n_failures:
        print('\n\nSummary: %d errors and %d failures reported\n'%\
            (n_errors, n_failures))

    print()

    sys.exit(n_errors+n_failures) 
Example #6
Source File: test_build_py.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildPyTestCase) 
Example #7
Source File: test_func.py    From pylint-flask with GNU General Public License v2.0 5 votes vote down vote up
def suite():
    test_list = tests('input', 'messages')

    if module_exists('rest_framework'):
        test_list += tests('external_drf', '')

    return unittest.TestSuite(
        [unittest.makeSuite(test, suiteClass=unittest.TestSuite)
         for test in test_list]) 
Example #8
Source File: test_bdist_rpm.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildRpmTestCase) 
Example #9
Source File: test_bdist_dumb.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildDumbTestCase) 
Example #10
Source File: test_build.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildTestCase) 
Example #11
Source File: test_ccompiler.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(CCompilerTestCase) 
Example #12
Source File: test_compat.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(CompatibilityTestCase) 
Example #13
Source File: test_distributed_transactions.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()
    if db.version() >= (4,5) :
        suite.addTest(unittest.makeSuite(DBTxn_distributed))
        suite.addTest(unittest.makeSuite(DBTxn_distributedSYNC))
    if db.version() >= (4,6) :
        suite.addTest(unittest.makeSuite(DBTxn_distributed_must_open_db))
        suite.addTest(unittest.makeSuite(DBTxn_distributedSYNC_must_open_db))
    return suite 
Example #14
Source File: test_all.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def suite(module_prefix='', timing_check=None):
    test_modules = [
        'test_associate',
        'test_basics',
        'test_dbenv',
        'test_db',
        'test_compare',
        'test_compat',
        'test_cursor_pget_bug',
        'test_dbobj',
        'test_dbshelve',
        'test_dbtables',
        'test_distributed_transactions',
        'test_early_close',
        'test_fileid',
        'test_get_none',
        'test_join',
        'test_lock',
        'test_misc',
        'test_pickle',
        'test_queue',
        'test_recno',
        'test_replication',
        'test_sequence',
        'test_thread',
        ]

    alltests = unittest.TestSuite()
    for name in test_modules:
        #module = __import__(name)
        # Do it this way so that suite may be called externally via
        # python's Lib/test/test_bsddb3.
        module = __import__(module_prefix+name, globals(), locals(), name)

        alltests.addTest(module.test_suite())
        if timing_check:
            alltests.addTest(unittest.makeSuite(timing_check))
    return alltests 
Example #15
Source File: test_all.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(PrintInfoFakeTest))
    return suite 
Example #16
Source File: test_db.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()

    suite.addTest(unittest.makeSuite(DB_general))
    suite.addTest(unittest.makeSuite(DB_txn))
    suite.addTest(unittest.makeSuite(DB_hash))
    suite.addTest(unittest.makeSuite(DB_recno))
    suite.addTest(unittest.makeSuite(DB_queue))

    return suite 
Example #17
Source File: test_queue.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(SimpleQueueTestCase) 
Example #18
Source File: test_dir_util.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(DirUtilTestCase) 
Example #19
Source File: test_unixccompiler.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(UnixCCompilerTestCase) 
Example #20
Source File: test_build_scripts.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildScriptsTestCase) 
Example #21
Source File: test_config.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(PyPIRCCommandTestCase) 
Example #22
Source File: test_install_scripts.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(InstallScriptsTestCase) 
Example #23
Source File: test_text_file.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(TextFileTestCase) 
Example #24
Source File: test_archive_util.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(ArchiveUtilTestCase) 
Example #25
Source File: test_core.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(CoreTestCase) 
Example #26
Source File: test_filelist.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(FileListTestCase) 
Example #27
Source File: test_bdist_wininst.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(BuildWinInstTestCase) 
Example #28
Source File: test_install_headers.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(InstallHeadersTestCase) 
Example #29
Source File: test_spawn.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    return unittest.makeSuite(SpawnTestCase) 
Example #30
Source File: test_dbshelve.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_suite():
    suite = unittest.TestSuite()

    suite.addTest(unittest.makeSuite(DBShelveTestCase))
    suite.addTest(unittest.makeSuite(BTreeShelveTestCase))
    suite.addTest(unittest.makeSuite(HashShelveTestCase))
    suite.addTest(unittest.makeSuite(ThreadBTreeShelveTestCase))
    suite.addTest(unittest.makeSuite(ThreadHashShelveTestCase))
    suite.addTest(unittest.makeSuite(EnvBTreeShelveTestCase))
    suite.addTest(unittest.makeSuite(EnvHashShelveTestCase))
    suite.addTest(unittest.makeSuite(EnvThreadBTreeShelveTestCase))
    suite.addTest(unittest.makeSuite(EnvThreadHashShelveTestCase))
    suite.addTest(unittest.makeSuite(RecNoShelveTestCase))

    return suite