try: try: # If possible, you should copy the _psycopg.pyd file into a top level # so the SM can avoid importing the entire package. import _psycopg except ImportError: from psycopg2 import _psycopg except ImportError: def run(): import warnings warnings.warn("The psycopg2._psycopg module could not be imported. " "The psycopg test will not be run.") else: user = "geniusql_test" passwd = "geniusql_test" opts = {'connections.Connect': ("host=localhost dbname=geniusql_test user=%s password=%s" % (user, passwd)), 'name': 'geniusql_test', 'encoding': 'UTF8', } DB_class = "psycopg" from geniusql.test import zoo_fixture, test db = test.DBConfig(DB_class, opts) setUp = db.setUp tearDown = db.tearDown #--------------------------------------------------------------------------- class Phase1_ZooTests(zoo_fixture.Phase1_ZooTests): pass db.register_db_test_class(Phase1_ZooTests) #--------------------------------------------------------------------------- class Phase2_ConcurrencyTests(zoo_fixture.Phase2_ConcurrencyTests): pass db.register_db_test_class(Phase2_ConcurrencyTests) #--------------------------------------------------------------------------- class Phase2_IsolationTests(zoo_fixture.Phase2_IsolationTests): pass db.register_db_test_class(Phase2_IsolationTests) #--------------------------------------------------------------------------- class Phase2_TransactionTests(zoo_fixture.Phase2_TransactionTests): pass db.register_db_test_class(Phase2_TransactionTests) #--------------------------------------------------------------------------- # TODO: this isn't ported yet. #class Phase2_NumericTests(zoo_fixture.Phase2_NumericTests): #pass #db.register_db_test_class(Phase2_NumericTests) #--------------------------------------------------------------------------- class Phase2_ConnectionTests(zoo_fixture.Phase2_ConnectionTests): pass db.register_db_test_class(Phase2_ConnectionTests) #--------------------------------------------------------------------------- class Phase2_SQLInjectionTests(zoo_fixture.Phase2_SQLInjectionTests): pass db.register_db_test_class(Phase2_SQLInjectionTests)