tests.py
author Radek Brich <brich.radek@ifortuna.cz>
Tue, 06 May 2014 18:37:43 +0200
changeset 101 2a2d0d5df03b
parent 83 515fadd3d286
permissions -rwxr-xr-x
Refactor ToolBase to allow tool composition. Add TableSync tool (composited). Move more tools under pgtool.

#!/usr/bin/env python3

import unittest

from tests import test_rowdict
from tests import test_pgmanager

enable_mysql = True
try:
    from tests import test_mymanager
except ImportError as e:
    print('Disabling MySQL tests due to import error:\n ', str(e))
    enable_mysql = False

loader = unittest.TestLoader()

suite = unittest.TestSuite()
suite.addTests(loader.loadTestsFromModule(test_rowdict))
suite.addTests(loader.loadTestsFromModule(test_pgmanager))

if enable_mysql:
    suite.addTests(loader.loadTestsFromModule(test_mymanager))

runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)