def kill_database(): empty_database(engine, session) from backend.database import startup monkeypatch.setattr(startup, 'stored_session', None) monkeypatch.setattr(startup, 'stored_redis', None) monkeypatch.setattr(startup, 'redis_attempted', False)
def test_clear_database(self, engine): match = self.session.query(PlayerGame).filter( PlayerGame.game == self.guid).first() assert (match is not None) empty_database(engine) match = self.session.query(PlayerGame).filter( PlayerGame.game == self.guid).first() assert (match is None)
def kill_database(): engine, session = EngineStartup.login_db() empty_database(engine, session)