public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:multilib commit in: pym/portage/tests/lint/
@ 2011-02-06 13:09 Thomas Sachau
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Sachau @ 2011-02-06 13:09 UTC (permalink / raw
  To: gentoo-commits

commit:     524630d15e9a8ab4cdba61a775dc15c4f70d88fb
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Mon Jan 31 07:30:26 2011 +0000
Commit:     Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Mon Jan 31 07:35:54 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=524630d1

test/lint/test_import_modules.py: Better error reporting and expected failures

---
 pym/portage/tests/lint/test_import_modules.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/tests/lint/test_import_modules.py
index cee579a..c0551c7 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 = []



^ permalink raw reply related	[flat|nested] 2+ messages in thread
* [gentoo-commits] proj/portage:multilib commit in: pym/portage/tests/lint/
@ 2011-02-06 13:09 Thomas Sachau
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Sachau @ 2011-02-06 13:09 UTC (permalink / raw
  To: gentoo-commits

commit:     72aa86e97367849e7dd867d0320bbf0b91c836a6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 31 22:28:12 2011 +0000
Commit:     Thomas Sachau <tommy <AT> gentoo <DOT> org>
CommitDate: Mon Jan 31 22:28:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=72aa86e9

ImportModulesTestCase: use iterator, not list

---
 pym/portage/tests/lint/test_import_modules.py |    9 +++------
 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 87bb4bf..8d257c5 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-06 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-06 13:09 [gentoo-commits] proj/portage:multilib commit in: pym/portage/tests/lint/ Thomas Sachau
  -- strict thread matches above, loose matches on Subject: below --
2011-02-06 13:09 Thomas Sachau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox