Пример #1
0
    def tearDown(self):
        # Drop MySQL tables.
        db_session.remove()
        engine.dispose()
        delete_db()

        # Empty ES index.
        es.drop_and_create_index()

        return super(DatabaseTest, self).tearDown()
Пример #2
0
    def setUp(self):

        # pylint:disable=unused-variable
        # Imports are used by SQLAlchemy to know what tables to create.
        from labonneboite.importer.models.computing import Dpae, DpaeStatistics, ImportTask
        # pylint:enable=unused-variable

        db_session.remove()
        engine.dispose()
        delete_db()
        init_db()

        return super(DatabaseTest, self).setUp()
Пример #3
0
 def shutdown_session(exception=None):
     db_session.remove()
     engine.dispose()