summaryrefslogtreecommitdiff
path: root/Lib/test/test_pyclbr.py
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2012-05-18 21:51:11 +0300
committerPetri Lehtinen <petri@digip.org>2012-05-18 21:59:49 +0300
commit43ae3ceab8dd65d184aef1773714a604984de38e (patch)
tree67f19442c468077fd4e32c8f8f35d6fdbe6234d3 /Lib/test/test_pyclbr.py
parented3639595aabd3913088c830d345e7db88d9060d (diff)
parent8d886046821f1cd43147c340b04ee0f067157749 (diff)
downloadcpython-git-43ae3ceab8dd65d184aef1773714a604984de38e.tar.gz
#14798: pyclbr now raises ImportError instead of KeyError for missing packages
Diffstat (limited to 'Lib/test/test_pyclbr.py')
-rw-r--r--Lib/test/test_pyclbr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 3082b29dbc..e83989e2d8 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -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)