#14798: pyclbr now raises ImportError instead of KeyError for missing packages

This commit is contained in:
Petri Lehtinen 2012-05-18 21:51:11 +03:00
parent 1033b310a3
commit 8d88604682
4 changed files with 12 additions and 0 deletions

View file

@ -167,6 +167,11 @@ class PyclbrTest(TestCase):
cm('email.parser')
cm('test.test_pyclbr')
def test_issue_14798(self):
# test ImportError is raised when the first part of a dotted name is
# not a package
self.assertRaises(ImportError, pyclbr.readmodule_ex, 'asyncore.foo')
def test_main():
run_unittest(PyclbrTest)