Ejemplo n.º 1
0
 def dispose(self):
     from fixture.dataset import dataset_registry
     dataset_registry.clear()
     if self.connection:
         self.connection.close()
     if self.session:
         if self.session.bind_to:
             self.session.bind_to.dispose()
         self.session.close()
     if self.transaction:
         self.transaction.close()
Ejemplo n.º 2
0
 def dispose(self):
     """Dispose of this fixture instance entirely
     
     Closes all connection, session, and transaction objects and calls engine.dispose()
     
     After calling fixture.dispose() you cannot use the fixture instance.  
     Instead you have to create a new instance like::
     
         fixture = SQLAlchemyFixture(...)
     
     """
     from fixture.dataset import dataset_registry
     dataset_registry.clear()
     if self.connection:
         self.connection.close()
     if self.session:
         self.session.close()
     if self.transaction:
         self.transaction.close()
     if self.engine:
         self.engine.dispose()
Ejemplo n.º 3
0
 def unloader():
     for dataset in self.loaded.to_unload():
         self.unload_dataset(dataset)
     self.loaded.clear()
     dataset_registry.clear()
Ejemplo n.º 4
0
 def unloader():
     for dataset in self.loaded.to_unload():
         self.unload_dataset(dataset)
     self.loaded.clear()
     dataset_registry.clear()