Refactor/speed up test_build_gettext using generators