Esempio n. 1
0
    def setUp(self):
        super(DbFixture, self).setUp()

        try:
            self.provision = provision.ProvisionedDatabase(self.DRIVER)
            self.addCleanup(self.provision.dispose)
        except exception.BackendNotAvailable:
            msg = "%s backend is not available." % self.DRIVER
            return self.test.skip(msg)
        else:
            self.test.engine = self.provision.engine
            self.addCleanup(setattr, self.test, "engine", None)
            self.test.sessionmaker = session.get_maker(self.test.engine)
            self.addCleanup(setattr, self.test, "sessionmaker", None)
Esempio n. 2
0
    def setUp(self):
        super(DbFixture, self).setUp()

        try:
            self.provision = provision.ProvisionedDatabase(self.DRIVER)
            self.addCleanup(self.provision.dispose)
        except exception.BackendNotAvailable:
            msg = '%s backend is not available.' % self.DRIVER
            return self.test.skip(msg)
        else:
            self.test.engine = self.provision.engine
            self.addCleanup(setattr, self.test, 'engine', None)
            self.test.sessionmaker = session.get_maker(self.test.engine)
            self.addCleanup(setattr, self.test, 'sessionmaker', None)
Esempio n. 3
0
    def setUp(self):
        super(DbFixture, self).setUp()

        self.test.engine = session.create_engine(self._get_uri())
        self.test.sessionmaker = session.get_maker(self.test.engine)
Esempio n. 4
0
    def setUp(self):
        super(DbFixture, self).setUp()

        self.test.engine = session.create_engine(self._get_uri())
        self.test.sessionmaker = session.get_maker(self.test.engine)