[Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,1.7,1.8

Skip Montanaro montanaro@users.sourceforge.net
Thu, 25 Jan 2001 07:29:25 -0800


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv10247/Lib/test

Modified Files:
	test___all__.py 
Log Message:
added a few more __all__ lists
test___all__.py: fail silently in check_all if the module can't be imported


Index: test___all__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test___all__.py	2001/01/24 06:27:27	1.7
--- test___all__.py	2001/01/25 15:29:22	1.8
***************
*** 4,8 ****
  def check_all(modname):
      names = {}
!     exec "import %s" % modname in names
      verify(hasattr(sys.modules[modname], "__all__"),
             "%s has no __all__ attribute" % modname)
--- 4,13 ----
  def check_all(modname):
      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)
***************
*** 49,59 ****
  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("dircache")
  check_all("dis")
--- 54,58 ----
  check_all("copy")
  check_all("copy_reg")
! check_all("dbhash")
  check_all("dircache")
  check_all("dis")
***************
*** 86,88 ****
--- 85,90 ----
  check_all("mailbox")
  check_all("mhlib")
+ check_all("mimetools")
+ check_all("mimetypes")
+ check_all("mimify")
  check_all("robotparser")