[Python-checkins] CVS: python/dist/src/Lib/test test_b2.py,1.17,1.18
Barry Warsaw
python-dev@python.org
Sat, 30 Sep 2000 21:28:48 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv6740
Modified Files:
test_b2.py
Log Message:
Added a zip() test where one of the arguments is an instance whose
class has no __getitem__(). This raises an AttributeError.
Index: test_b2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b2.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** test_b2.py 2000/09/19 14:42:09 1.17
--- test_b2.py 2000/10/01 04:28:43 1.18
***************
*** 291,294 ****
--- 291,306 ----
if not exc:
raise TestFailed, 'zip(None) - missing expected TypeError'
+ class G:
+ pass
+ exc = 0
+ try:
+ zip(a, G())
+ except AttributeError:
+ exc = 1
+ except:
+ e = sys.exc_info()[0]
+ raise TestFailed, 'zip(a, b) - b instance w/o __getitem__'
+ if not exc:
+ raise TestFailed, 'zip(a, b) - missing expected AttributeError'