summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/tests/lint/test_import_modules.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/tests/lint/test_import_modules.py
index 87bb4bf07..8d257c5a6 100644
--- a/pym/portage/tests/lint/test_import_modules.py
+++ b/pym/portage/tests/lint/test_import_modules.py
@@ -13,7 +13,7 @@ class ImportModulesTestCase(TestCase):
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:
@@ -21,8 +21,7 @@ class ImportModulesTestCase(TestCase):
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')
@@ -38,6 +37,4 @@ class ImportModulesTestCase(TestCase):
x = parent_mod
else:
x = parent_mod + "." + x
- all_modules.append(x)
-
- return all_modules
+ yield x