summaryrefslogtreecommitdiffstats
path: root/Lib/test/test___all__.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2001-01-25 15:29:22 (GMT)
committerSkip Montanaro <skip@pobox.com>2001-01-25 15:29:22 (GMT)
commit03d90149920274b58f6ab121caae81ae9c424946 (patch)
tree8bea349ad17369f28f22d176b5a6e0fedc7c2542 /Lib/test/test___all__.py
parent438bb947893e92455decfaadd739034fe26e192a (diff)
downloadcpython-03d90149920274b58f6ab121caae81ae9c424946.zip
cpython-03d90149920274b58f6ab121caae81ae9c424946.tar.gz
cpython-03d90149920274b58f6ab121caae81ae9c424946.tar.bz2
added a few more __all__ lists
test___all__.py: fail silently in check_all if the module can't be imported
Diffstat (limited to 'Lib/test/test___all__.py')
-rw-r--r--Lib/test/test___all__.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 079f98c..f11a0c7 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -3,7 +3,12 @@ import sys
def check_all(modname):
names = {}
- exec "import %s" % modname in names
+ try:
+ exec "import %s" % modname in names
+ except ImportError:
+ # silent fail here seems the best route since some modules
+ # may not be available in all environments
+ return
verify(hasattr(sys.modules[modname], "__all__"),
"%s has no __all__ attribute" % modname)
names = {}
@@ -48,13 +53,7 @@ check_all("commands")
check_all("compileall")
check_all("copy")
check_all("copy_reg")
-try:
- import bsddb
-except ImportError:
- if verbose:
- print "can't import bsddb, so skipping dbhash"
-else:
- check_all("dbhash")
+check_all("dbhash")
check_all("dircache")
check_all("dis")
check_all("doctest")
@@ -85,4 +84,7 @@ check_all("macpath")
check_all("macurl2path")
check_all("mailbox")
check_all("mhlib")
+check_all("mimetools")
+check_all("mimetypes")
+check_all("mimify")
check_all("robotparser")