expected_failures = frozenset((
))
- for mod in self._list_modules(PORTAGE_PYM_PATH):
+ for mod in self._iter_modules(PORTAGE_PYM_PATH):
try:
__import__(mod)
except ImportError as e:
self.assertTrue(False, "failed to import '%s': %s" % (mod, e))
del e
- def _list_modules(self, base_dir):
- all_modules = []
+ def _iter_modules(self, base_dir):
for parent, dirs, files in os.walk(base_dir):
parent = _unicode_decode(parent,
encoding=_encodings['fs'], errors='strict')
x = parent_mod
else:
x = parent_mod + "." + x
- all_modules.append(x)
-
- return all_modules
+ yield x