Hi, I am trying to move my unit tests from using an sqlite file to using sqlite in-memory.
The first problem I have is in websetup.py After the db is created, I insert some sample data, but the part that checks for and inserts sample data says that the table is present. I suspect that the db is created in one connection and the sample data is added in another, so the in memory db is gone. If I comment out the sample data bit (they are not needed for unit tests anyway), then the unit tests themselves give a similar error. I originally followed the instructions for unit testing at http://wiki.pylonshq.com/display/pylonsdocs/Unit+Testing Currently my model/__init__.py says: Session = scoped_session(sessionmaker(autoflush=True, autocommit=True, bind=config['pylons.g'].sa_engine)) metadata = MetaData() websetup.py creates the db with: engine = config['pylons.g'].sa_engine model.metadata.create_all(bind=engine) Then I usually access the db with: model.Session Can anyone give any tips as to the best way to do my testing with an sqlite in-memory db? Ideally with minimal changes to the existing way that it works with production persistant dbs. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
