summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2012-05-18 18:51:11 (GMT)
committerPetri Lehtinen <petri@digip.org>2012-05-18 18:56:36 (GMT)
commit8d886046821f1cd43147c340b04ee0f067157749 (patch)
treec46b43c88321138073c3c3d566a2fdc8382f1ed9 /Lib/test
parent1033b310a34f65a1c976bdfe974e44cfcd9f0d1e (diff)
downloadcpython-8d886046821f1cd43147c340b04ee0f067157749.zip
cpython-8d886046821f1cd43147c340b04ee0f067157749.tar.gz
cpython-8d886046821f1cd43147c340b04ee0f067157749.tar.bz2
#14798: pyclbr now raises ImportError instead of KeyError for missing packages
Diffstat (limited to 'Lib/test')
-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 3082b29..e83989e 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)