[Python-checkins] CVS: python/dist/src/Lib/test test_operations.py,1.1,1.2

Fred L. Drake python-dev@python.org
Thu, 31 Aug 2000 12:48:54 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv5388/Lib/test

Modified Files:
	test_operations.py 
Log Message:

Test case to exercise fix for error propogation bug in dictionarys.


Index: test_operations.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_operations.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_operations.py	1992/01/27 16:56:04	1.1
--- test_operations.py	2000/08/31 19:48:51	1.2
***************
*** 3,5 ****
  
  print '3. Operations'
! print 'XXX Not yet implemented'
--- 3,28 ----
  
  print '3. Operations'
! print 'XXX Mostly not yet implemented'
! 
! 
! print '3.1 Dictionary lookups succeed even if __cmp__() raises an exception'
! 
! # SourceForge bug #112558:
! # http://sourceforge.net/bugs/?func=detailbug&bug_id=112558&group_id=5470
! 
! class BadDictKey: 
!     def __hash__(self): 
!         return hash(self.__class__) 
! 
!     def __cmp__(self, other): 
!         if isinstance(other, self.__class__): 
!             print "raising error" 
!             raise RuntimeError, "gotcha" 
!         return other 
! 
! d = {}
! x1 = BadDictKey()
! x2 = BadDictKey()
! d[x1] = 1
! d[x2] = 2
! print "No exception passed through."