tests.py
author Radek Brich <radek.brich@devl.cz>
Fri, 15 Mar 2013 15:13:42 +0100
changeset 77 2cfef775f518
parent 75 39f777341db4
child 83 515fadd3d286
permissions -rwxr-xr-x
PgManager, MyManager: Change log level of SQL queries to debug. Fix MyManager: Wrong query logged when exception occurs.

#!/usr/bin/env python3

import unittest

from tests import test_rowdict
from tests import test_pgmanager
from tests import test_prettysize

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))
suite.addTests(loader.loadTestsFromModule(test_prettysize))

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

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