def pg_new(self, commit=UPGRADE_TO): """Setup DB with new schema.""" stashed = self._git_checkout(commit) pg_instance = create_pg() yield pg_instance pg_instance.stop() self._git_co_teardown(commit, stashed)
def pg_old(self, commit=UPGRADE_FROM): """Setup DB with old schema.""" stashed = self._git_checkout(commit) pg_factory = create_pg() pg_instance = pg_factory() yield pg_instance pg_instance.stop() pg_factory.clear_cache() self._git_co_teardown(commit, stashed)