From 524630d15e9a8ab4cdba61a775dc15c4f70d88fb Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Mon, 31 Jan 2011 08:30:26 +0100 Subject: test/lint/test_import_modules.py: Better error reporting and expected failures --- pym/portage/tests/lint/test_import_modules.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pym') 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 = [] -- cgit v1.2.3-1-g7c22