From: Sebastian Luther Date: Mon, 31 Jan 2011 07:30:26 +0000 (+0100) Subject: test/lint/test_import_modules.py: Better error reporting and expected failures X-Git-Tag: v2.2.0_alpha20~59 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=524630d15e9a8ab4cdba61a775dc15c4f70d88fb;p=portage.git test/lint/test_import_modules.py: Better error reporting and expected failures --- diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/tests/lint/test_import_modules.py index cee579a3a..c0551c7be 100644 --- a/pym/portage/tests/lint/test_import_modules.py +++ b/pym/portage/tests/lint/test_import_modules.py @@ -10,8 +10,17 @@ from portage import _unicode_decode class ImportModulesTestCase(TestCase): def testImportModules(self): + expected_failures = frozenset(( + "portage.cache.ebuild_xattr", #automagic dep on xattr + )) + for mod in self._list_modules(PORTAGE_PYM_PATH): - __import__(mod) + try: + __import__(mod) + except ImportError as e: + if mod not in expected_failures: + self.assertTrue(False, "failed to import '%s': %s" % (mod, e)) + del e def _list_modules(self, base_dir): all_modules = []