]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - bin/run_tests
Separate the tests that hit the database from the rest of the tests.
[dead/census-tools.git] / bin / run_tests
index 3a73264320e073acf430820a3539f31313e2307b..4ce94e771237ce22dfc15be61bf30cb5c9643cb0 100755 (executable)
@@ -5,6 +5,7 @@ import sys, os, site
 site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src')
 
 import unittest
+import Census
 from Tests.Unit import CensusTest
 from Tests.Unit import DistributionTest
 from Tests.Unit import FileUtilsTest
@@ -26,3 +27,13 @@ suite.addTest(LEHDTest.suite())
 suite.addTest(UniformDistributionTest.suite())
 suite.addTest(DistributionTest.suite())
 unittest.TextTestRunner(verbosity=2).run(suite)
+
+try:
+    # The Census.Database initialization will raise an exception
+    # if the database cannot be accessed.
+    cdb = Census.Database()
+    db_suite = unittest.TestSuite()
+    db_suite.addTest(CensusTest.db_suite())
+    unittest.TextTestRunner(verbosity=2).run(db_suite)
+except:
+    pass