def initTask(self): super(AtcdDBQueueTask, self).initTask() try: self.sqlite_manager = SQLiteManager(self.sqlite_file, self.logger) except OperationalError: self.logger.exception( 'Unable to initialize DB from file "{0}"'.format( self.sqlite_file)) raise
def test_sqlite_file_not_found(self): with pytest.raises(sqlite3.OperationalError): SQLiteManager('/this/path/should/not/exist')
def dbm(atc_db_file): return SQLiteManager(atc_db_file.name)