def __init__(self, request):
     db = request.param
     print ('dbtype', db[0], db[1])
     session_factory = SessionFactory(db[2])
     setSchema(session_factory.engine)
     assert session_factory is not None, ('failed to create a session for ', db[0], db[1])
     self.session = session_factory.getSession()
Beispiel #2
0
 def setup(self):
     self.connection_string = "sqlite:///:memory:"
     session_factory = SessionFactory(self.connection_string, echo=False)
     test_util.build_db(session_factory.engine)
     self.session = session_factory.getSession()
     self.series = test_util.add_series(self.session)
     self.data_values = self.series.data_values
Beispiel #3
0
 def __init__(self, request):
     db = request.param
     print('dbtype', db[0], db[1])
     session_factory = SessionFactory(db[2])
     setSchema(session_factory.engine)
     assert session_factory is not None, ('failed to create a session for ',
                                          db[0], db[1])
     self.session = session_factory.getSession()
Beispiel #4
0
    def __init__(self, request):
        #session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')
        db = request.param
        print ("dbtype", db[0], db[1] )
        #session_factory = dbconnection.createConnection(db[0],db[1],db[2],db[3],db[4], echo=True)
        session_factory = SessionFactory(db[2])
        setSchema(session_factory.engine)
        assert session_factory is not None, ("failed to create a session for ", db[0], db[1])
#        assert session_factory.engine is not None, ("failed: session has no engine ", db[0], db[1])
#
 #       insp = reflection.Inspector.from_engine(session_factory.engine)
#        tables = insp.get_table_names()

        self.session = session_factory.getSession()