Skip to content

Commit

Permalink
#6: Tech debt paid.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermechapiewski committed Feb 15, 2009
1 parent 7c579e9 commit 148fb7c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
7 changes: 0 additions & 7 deletions tests/_test_env.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/cli_test.py
@@ -1,4 +1,4 @@
from _test_env import *
from test import *
from cli import *
import unittest

Expand Down
2 changes: 1 addition & 1 deletion tests/core_test.py
@@ -1,4 +1,4 @@
from _test_env import *
from test import *
from core import *
from pmock import *
import unittest
Expand Down
2 changes: 1 addition & 1 deletion tests/mysql_test.py
@@ -1,4 +1,4 @@
from _test_env import *
from test import *
from mysql import *
from pmock import *
import os
Expand Down
46 changes: 46 additions & 0 deletions tests/test.py
@@ -0,0 +1,46 @@
import os
import sys
import unittest

sys.path.insert(0, os.path.abspath("."))
sys.path.insert(0, os.path.abspath("./tests"))
sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(0, os.path.abspath("../tests"))

if __name__ == "__main__":
from cli_test import *
from core_test import *
from mysql_test import *

test_suites = []

# add all tests to the test suite
# TODO: this could be done automatically
test_suites.append(unittest.TestLoader().loadTestsFromTestCase(CLITest))
test_suites.append(unittest.TestLoader().loadTestsFromTestCase(SimpleDBMigrateTest))
test_suites.append(unittest.TestLoader().loadTestsFromTestCase(MySQLTest))

alltests = unittest.TestSuite(test_suites)

result = unittest.TestResult()
alltests.run(result)

if result.wasSuccessful():
print "\nAll %d tests passed :)\n" % result.testsRun
else:
print "\nError in tests (%d runned, %d errors, %d failures)\n" % (result.testsRun, len(result.errors), len(result.failures))

for problems in [result.errors, result.failures]:
for problem in problems:
print "======================================================================"
i = 0
for info in problem:
if i == 1:
print "----------------------------------------------------------------------"
if i == 0:
print "FAIL: %s" % info
else:
print info
i += 1
print "----------------------------------------------------------------------"
print ""

0 comments on commit 148fb7c

Please sign in to comment.