blob: ae07f5b8def62bdb8494e9ae7abe3e645fa336ff [file] [log] [blame]
Guido van Rossum3bead091992-01-27 17:00:37 +00001# Python test set -- part 4b, built-in functions n-z
2
3from test_support import *
4
5print 'oct'
6if oct(100) != '0144': raise TestFailed, 'oct(100)'
7if oct(100L) != '0144L': raise TestFailed, 'oct(100L)'
Guido van Rossumd9c6f4f1997-06-06 21:14:14 +00008if oct(-100) not in ('037777777634', '01777777777777777777634'):
Fred Drake004d5e62000-10-23 17:22:08 +00009 raise TestFailed, 'oct(-100)'
Guido van Rossum3bead091992-01-27 17:00:37 +000010if oct(-100L) != '-0144L': raise TestFailed, 'oct(-100L)'
11
12print 'open'
13# NB the first 4 lines are also used to test input and raw_input, below
14fp = open(TESTFN, 'w')
15try:
Fred Drake004d5e62000-10-23 17:22:08 +000016 fp.write('1+1\n')
17 fp.write('1+1\n')
18 fp.write('The quick brown fox jumps over the lazy dog')
19 fp.write('.\n')
20 fp.write('Dear John\n')
21 fp.write('XXX'*100)
22 fp.write('YYY'*100)
Guido van Rossum3bead091992-01-27 17:00:37 +000023finally:
Fred Drake004d5e62000-10-23 17:22:08 +000024 fp.close()
Guido van Rossum3bead091992-01-27 17:00:37 +000025#
26fp = open(TESTFN, 'r')
27try:
Fred Drake132dce22000-12-12 23:11:42 +000028 if fp.readline(4) != '1+1\n': raise TestFailed, 'readline(4) # exact'
29 if fp.readline(4) != '1+1\n': raise TestFailed, 'readline(4) # exact'
30 if fp.readline() != 'The quick brown fox jumps over the lazy dog.\n':
Fred Drake004d5e62000-10-23 17:22:08 +000031 raise TestFailed, 'readline() # default'
Fred Drake132dce22000-12-12 23:11:42 +000032 if fp.readline(4) != 'Dear': raise TestFailed, 'readline(4) # short'
33 if fp.readline(100) != ' John\n': raise TestFailed, 'readline(100)'
34 if fp.read(300) != 'XXX'*100: raise TestFailed, 'read(300)'
35 if fp.read(1000) != 'YYY'*100: raise TestFailed, 'read(1000) # truncate'
Guido van Rossum3bead091992-01-27 17:00:37 +000036finally:
Fred Drake004d5e62000-10-23 17:22:08 +000037 fp.close()
Guido van Rossum3bead091992-01-27 17:00:37 +000038
39print 'ord'
Fred Drake132dce22000-12-12 23:11:42 +000040if ord(' ') != 32: raise TestFailed, 'ord(\' \')'
41if ord('A') != 65: raise TestFailed, 'ord(\'A\')'
42if ord('a') != 97: raise TestFailed, 'ord(\'a\')'
Guido van Rossum3bead091992-01-27 17:00:37 +000043
44print 'pow'
Fred Drake132dce22000-12-12 23:11:42 +000045if pow(0,0) != 1: raise TestFailed, 'pow(0,0)'
46if pow(0,1) != 0: raise TestFailed, 'pow(0,1)'
47if pow(1,0) != 1: raise TestFailed, 'pow(1,0)'
48if pow(1,1) != 1: raise TestFailed, 'pow(1,1)'
Guido van Rossum3bead091992-01-27 17:00:37 +000049#
Fred Drake132dce22000-12-12 23:11:42 +000050if pow(2,0) != 1: raise TestFailed, 'pow(2,0)'
51if pow(2,10) != 1024: raise TestFailed, 'pow(2,10)'
52if pow(2,20) != 1024*1024: raise TestFailed, 'pow(2,20)'
53if pow(2,30) != 1024*1024*1024: raise TestFailed, 'pow(2,30)'
Guido van Rossum3bead091992-01-27 17:00:37 +000054#
Fred Drake132dce22000-12-12 23:11:42 +000055if pow(-2,0) != 1: raise TestFailed, 'pow(-2,0)'
56if pow(-2,1) != -2: raise TestFailed, 'pow(-2,1)'
57if pow(-2,2) != 4: raise TestFailed, 'pow(-2,2)'
58if pow(-2,3) != -8: raise TestFailed, 'pow(-2,3)'
Guido van Rossum3bead091992-01-27 17:00:37 +000059#
Fred Drake132dce22000-12-12 23:11:42 +000060if pow(0L,0) != 1: raise TestFailed, 'pow(0L,0)'
61if pow(0L,1) != 0: raise TestFailed, 'pow(0L,1)'
62if pow(1L,0) != 1: raise TestFailed, 'pow(1L,0)'
63if pow(1L,1) != 1: raise TestFailed, 'pow(1L,1)'
Guido van Rossum3bead091992-01-27 17:00:37 +000064#
Fred Drake132dce22000-12-12 23:11:42 +000065if pow(2L,0) != 1: raise TestFailed, 'pow(2L,0)'
66if pow(2L,10) != 1024: raise TestFailed, 'pow(2L,10)'
67if pow(2L,20) != 1024*1024: raise TestFailed, 'pow(2L,20)'
68if pow(2L,30) != 1024*1024*1024: raise TestFailed, 'pow(2L,30)'
Guido van Rossum3bead091992-01-27 17:00:37 +000069#
Fred Drake132dce22000-12-12 23:11:42 +000070if pow(-2L,0) != 1: raise TestFailed, 'pow(-2L,0)'
71if pow(-2L,1) != -2: raise TestFailed, 'pow(-2L,1)'
72if pow(-2L,2) != 4: raise TestFailed, 'pow(-2L,2)'
73if pow(-2L,3) != -8: raise TestFailed, 'pow(-2L,3)'
Guido van Rossum3bead091992-01-27 17:00:37 +000074#
Guido van Rossum35fb82a1993-01-26 13:04:43 +000075if fcmp(pow(0.,0), 1.): raise TestFailed, 'pow(0.,0)'
76if fcmp(pow(0.,1), 0.): raise TestFailed, 'pow(0.,1)'
77if fcmp(pow(1.,0), 1.): raise TestFailed, 'pow(1.,0)'
78if fcmp(pow(1.,1), 1.): raise TestFailed, 'pow(1.,1)'
Guido van Rossum3bead091992-01-27 17:00:37 +000079#
Guido van Rossum35fb82a1993-01-26 13:04:43 +000080if fcmp(pow(2.,0), 1.): raise TestFailed, 'pow(2.,0)'
81if fcmp(pow(2.,10), 1024.): raise TestFailed, 'pow(2.,10)'
82if fcmp(pow(2.,20), 1024.*1024.): raise TestFailed, 'pow(2.,20)'
83if fcmp(pow(2.,30), 1024.*1024.*1024.): raise TestFailed, 'pow(2.,30)'
Guido van Rossum3bead091992-01-27 17:00:37 +000084#
85# XXX These don't work -- negative float to the float power...
Guido van Rossum35fb82a1993-01-26 13:04:43 +000086#if fcmp(pow(-2.,0), 1.): raise TestFailed, 'pow(-2.,0)'
87#if fcmp(pow(-2.,1), -2.): raise TestFailed, 'pow(-2.,1)'
88#if fcmp(pow(-2.,2), 4.): raise TestFailed, 'pow(-2.,2)'
89#if fcmp(pow(-2.,3), -8.): raise TestFailed, 'pow(-2.,3)'
Guido van Rossume23b62f1994-11-10 22:25:26 +000090#
91for x in 2, 2L, 2.0:
Fred Drake004d5e62000-10-23 17:22:08 +000092 for y in 10, 10L, 10.0:
93 for z in 1000, 1000L, 1000.0:
94 if fcmp(pow(x, y, z), 24.0):
95 raise TestFailed, 'pow(%s, %s, %s)' % (x, y, z)
Guido van Rossum3bead091992-01-27 17:00:37 +000096
97print 'range'
Fred Drake132dce22000-12-12 23:11:42 +000098if range(3) != [0, 1, 2]: raise TestFailed, 'range(3)'
99if range(1, 5) != [1, 2, 3, 4]: raise TestFailed, 'range(1, 5)'
100if range(0) != []: raise TestFailed, 'range(0)'
101if range(-3) != []: raise TestFailed, 'range(-3)'
102if range(1, 10, 3) != [1, 4, 7]: raise TestFailed, 'range(1, 10, 3)'
103if range(5, -5, -3) != [5, 2, -1, -4]: raise TestFailed, 'range(5, -5, -3)'
Guido van Rossum3bead091992-01-27 17:00:37 +0000104
105print 'input and raw_input'
106import sys
107fp = open(TESTFN, 'r')
108savestdin = sys.stdin
109try:
Fred Drake004d5e62000-10-23 17:22:08 +0000110 sys.stdin = fp
Fred Drake132dce22000-12-12 23:11:42 +0000111 if input() != 2: raise TestFailed, 'input()'
112 if input('testing\n') != 2: raise TestFailed, 'input()'
113 if raw_input() != 'The quick brown fox jumps over the lazy dog.':
Fred Drake004d5e62000-10-23 17:22:08 +0000114 raise TestFailed, 'raw_input()'
Fred Drake132dce22000-12-12 23:11:42 +0000115 if raw_input('testing\n') != 'Dear John':
Fred Drake004d5e62000-10-23 17:22:08 +0000116 raise TestFailed, 'raw_input(\'testing\\n\')'
Guido van Rossum3bead091992-01-27 17:00:37 +0000117finally:
Fred Drake004d5e62000-10-23 17:22:08 +0000118 sys.stdin = savestdin
119 fp.close()
Guido van Rossum3bead091992-01-27 17:00:37 +0000120
Guido van Rossume65cce51993-11-08 15:05:21 +0000121print 'reduce'
Fred Drake132dce22000-12-12 23:11:42 +0000122if reduce(lambda x, y: x+y, ['a', 'b', 'c'], '') != 'abc':
Fred Drake004d5e62000-10-23 17:22:08 +0000123 raise TestFailed, 'reduce(): implode a string'
Guido van Rossumae3b3a31993-11-30 13:43:54 +0000124if reduce(lambda x, y: x+y,
Fred Drake132dce22000-12-12 23:11:42 +0000125 [['a', 'c'], [], ['d', 'w']], []) != ['a','c','d','w']:
Fred Drake004d5e62000-10-23 17:22:08 +0000126 raise TestFailed, 'reduce(): append'
Fred Drake132dce22000-12-12 23:11:42 +0000127if reduce(lambda x, y: x*y, range(2,8), 1) != 5040:
Fred Drake004d5e62000-10-23 17:22:08 +0000128 raise TestFailed, 'reduce(): compute 7!'
Fred Drake132dce22000-12-12 23:11:42 +0000129if reduce(lambda x, y: x*y, range(2,21), 1L) != 2432902008176640000L:
Fred Drake004d5e62000-10-23 17:22:08 +0000130 raise TestFailed, 'reduce(): compute 20!, use long'
Guido van Rossumb6775db1994-08-01 11:34:53 +0000131class Squares:
Fred Drake004d5e62000-10-23 17:22:08 +0000132 def __init__(self, max):
133 self.max = max
134 self.sofar = []
135 def __len__(self): return len(self.sofar)
136 def __getitem__(self, i):
137 if not 0 <= i < self.max: raise IndexError
138 n = len(self.sofar)
139 while n <= i:
140 self.sofar.append(n*n)
141 n = n+1
142 return self.sofar[i]
Guido van Rossumb6775db1994-08-01 11:34:53 +0000143if reduce(lambda x, y: x+y, Squares(10)) != 285:
Fred Drake004d5e62000-10-23 17:22:08 +0000144 raise TestFailed, 'reduce(<+>, Squares(10))'
Guido van Rossumb6775db1994-08-01 11:34:53 +0000145if reduce(lambda x, y: x+y, Squares(10), 0) != 285:
Fred Drake004d5e62000-10-23 17:22:08 +0000146 raise TestFailed, 'reduce(<+>, Squares(10), 0)'
Guido van Rossumb6775db1994-08-01 11:34:53 +0000147if reduce(lambda x, y: x+y, Squares(0), 0) != 0:
Fred Drake004d5e62000-10-23 17:22:08 +0000148 raise TestFailed, 'reduce(<+>, Squares(0), 0)'
Guido van Rossumb6775db1994-08-01 11:34:53 +0000149
Guido van Rossume65cce51993-11-08 15:05:21 +0000150
Guido van Rossum3bead091992-01-27 17:00:37 +0000151print 'reload'
Guido van Rossumeecf0351994-12-30 17:17:46 +0000152import marshal
153reload(marshal)
Guido van Rossum3bead091992-01-27 17:00:37 +0000154import string
155reload(string)
Guido van Rossum7995ed21997-08-02 03:19:26 +0000156## import sys
157## try: reload(sys)
158## except ImportError: pass
159## else: raise TestFailed, 'reload(sys) should fail'
Guido van Rossum3bead091992-01-27 17:00:37 +0000160
Guido van Rossum85f18201992-11-27 22:53:50 +0000161print 'repr'
Fred Drake132dce22000-12-12 23:11:42 +0000162if repr('') != '\'\'': raise TestFailed, 'repr(\'\')'
163if repr(0) != '0': raise TestFailed, 'repr(0)'
164if repr(0L) != '0L': raise TestFailed, 'repr(0L)'
165if repr(()) != '()': raise TestFailed, 'repr(())'
166if repr([]) != '[]': raise TestFailed, 'repr([])'
167if repr({}) != '{}': raise TestFailed, 'repr({})'
Guido van Rossum85f18201992-11-27 22:53:50 +0000168
Guido van Rossume7113b61993-03-29 11:30:50 +0000169print 'round'
Fred Drake132dce22000-12-12 23:11:42 +0000170if round(0.0) != 0.0: raise TestFailed, 'round(0.0)'
171if round(1.0) != 1.0: raise TestFailed, 'round(1.0)'
172if round(10.0) != 10.0: raise TestFailed, 'round(10.0)'
173if round(1000000000.0) != 1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000174 raise TestFailed, 'round(1000000000.0)'
Fred Drake132dce22000-12-12 23:11:42 +0000175if round(1e20) != 1e20: raise TestFailed, 'round(1e20)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000176
Fred Drake132dce22000-12-12 23:11:42 +0000177if round(-1.0) != -1.0: raise TestFailed, 'round(-1.0)'
178if round(-10.0) != -10.0: raise TestFailed, 'round(-10.0)'
179if round(-1000000000.0) != -1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000180 raise TestFailed, 'round(-1000000000.0)'
Fred Drake132dce22000-12-12 23:11:42 +0000181if round(-1e20) != -1e20: raise TestFailed, 'round(-1e20)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000182
Fred Drake132dce22000-12-12 23:11:42 +0000183if round(0.1) != 0.0: raise TestFailed, 'round(0.0)'
184if round(1.1) != 1.0: raise TestFailed, 'round(1.0)'
185if round(10.1) != 10.0: raise TestFailed, 'round(10.0)'
186if round(1000000000.1) != 1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000187 raise TestFailed, 'round(1000000000.0)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000188
Fred Drake132dce22000-12-12 23:11:42 +0000189if round(-1.1) != -1.0: raise TestFailed, 'round(-1.0)'
190if round(-10.1) != -10.0: raise TestFailed, 'round(-10.0)'
191if round(-1000000000.1) != -1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000192 raise TestFailed, 'round(-1000000000.0)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000193
Fred Drake132dce22000-12-12 23:11:42 +0000194if round(0.9) != 1.0: raise TestFailed, 'round(0.9)'
195if round(9.9) != 10.0: raise TestFailed, 'round(9.9)'
196if round(999999999.9) != 1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000197 raise TestFailed, 'round(999999999.9)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000198
Fred Drake132dce22000-12-12 23:11:42 +0000199if round(-0.9) != -1.0: raise TestFailed, 'round(-0.9)'
200if round(-9.9) != -10.0: raise TestFailed, 'round(-9.9)'
201if round(-999999999.9) != -1000000000.0:
Fred Drake004d5e62000-10-23 17:22:08 +0000202 raise TestFailed, 'round(-999999999.9)'
Guido van Rossume7113b61993-03-29 11:30:50 +0000203
Guido van Rossum3bead091992-01-27 17:00:37 +0000204print 'setattr'
205import sys
Guido van Rossume23b62f1994-11-10 22:25:26 +0000206setattr(sys, 'spam', 1)
207if sys.spam != 1: raise TestFailed, 'setattr(sys, \'spam\', 1)'
Jeremy Hyltonb7a77312001-07-30 22:49:11 +0000208try:
209 setattr(sys, 1, 'spam')
210except TypeError:
211 pass
212else:
213 raise TestFailed, "setattr(sys, 1, 'spam') should raise exception"
Guido van Rossum3bead091992-01-27 17:00:37 +0000214
Guido van Rossum85f18201992-11-27 22:53:50 +0000215print 'str'
Fred Drake132dce22000-12-12 23:11:42 +0000216if str('') != '': raise TestFailed, 'str(\'\')'
217if str(0) != '0': raise TestFailed, 'str(0)'
218if str(0L) != '0': raise TestFailed, 'str(0L)'
219if str(()) != '()': raise TestFailed, 'str(())'
220if str([]) != '[]': raise TestFailed, 'str([])'
221if str({}) != '{}': raise TestFailed, 'str({})'
Guido van Rossum85f18201992-11-27 22:53:50 +0000222
Guido van Rossume23b62f1994-11-10 22:25:26 +0000223print 'tuple'
Fred Drake132dce22000-12-12 23:11:42 +0000224if tuple(()) != (): raise TestFailed, 'tuple(())'
225if tuple((0, 1, 2, 3)) != (0, 1, 2, 3): raise TestFailed, 'tuple((0, 1, 2, 3))'
226if tuple([]) != (): raise TestFailed, 'tuple([])'
227if tuple([0, 1, 2, 3]) != (0, 1, 2, 3): raise TestFailed, 'tuple([0, 1, 2, 3])'
228if tuple('') != (): raise TestFailed, 'tuple('')'
229if tuple('spam') != ('s', 'p', 'a', 'm'): raise TestFailed, "tuple('spam')"
Guido van Rossume23b62f1994-11-10 22:25:26 +0000230
Guido van Rossum3bead091992-01-27 17:00:37 +0000231print 'type'
Fred Drake132dce22000-12-12 23:11:42 +0000232if type('') != type('123') or type('') == type(()):
Fred Drake004d5e62000-10-23 17:22:08 +0000233 raise TestFailed, 'type()'
Guido van Rossum3bead091992-01-27 17:00:37 +0000234
Guido van Rossume23b62f1994-11-10 22:25:26 +0000235print 'vars'
236a = b = None
237a = vars().keys()
238b = dir()
239a.sort()
240b.sort()
Fred Drake132dce22000-12-12 23:11:42 +0000241if a != b: raise TestFailed, 'vars()'
Guido van Rossume23b62f1994-11-10 22:25:26 +0000242import sys
243a = vars(sys).keys()
244b = dir(sys)
245a.sort()
246b.sort()
Fred Drake132dce22000-12-12 23:11:42 +0000247if a != b: raise TestFailed, 'vars(sys)'
Guido van Rossuma49d94a1995-08-11 14:24:35 +0000248def f0():
Fred Drake004d5e62000-10-23 17:22:08 +0000249 if vars() != {}: raise TestFailed, 'vars() in f0()'
Guido van Rossuma49d94a1995-08-11 14:24:35 +0000250f0()
251def f2():
Fred Drake004d5e62000-10-23 17:22:08 +0000252 f0()
253 a = 1
254 b = 2
255 if vars() != {'a': a, 'b': b}: raise TestFailed, 'vars() in f2()'
Guido van Rossuma49d94a1995-08-11 14:24:35 +0000256f2()
Guido van Rossume23b62f1994-11-10 22:25:26 +0000257
258print 'xrange'
Fred Drake132dce22000-12-12 23:11:42 +0000259if tuple(xrange(10)) != tuple(range(10)): raise TestFailed, 'xrange(10)'
260if tuple(xrange(5,10)) != tuple(range(5,10)): raise TestFailed, 'xrange(5,10)'
261if tuple(xrange(0,10,2)) != tuple(range(0,10,2)):
Fred Drake004d5e62000-10-23 17:22:08 +0000262 raise TestFailed, 'xrange(0,10,2)'
Guido van Rossume23b62f1994-11-10 22:25:26 +0000263
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000264print 'zip'
265a = (1, 2, 3)
266b = (4, 5, 6)
267t = [(1, 4), (2, 5), (3, 6)]
Fred Drake132dce22000-12-12 23:11:42 +0000268if zip(a, b) != t: raise TestFailed, 'zip(a, b) - same size, both tuples'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000269b = [4, 5, 6]
Fred Drake132dce22000-12-12 23:11:42 +0000270if zip(a, b) != t: raise TestFailed, 'zip(a, b) - same size, tuple/list'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000271b = (4, 5, 6, 7)
Fred Drake132dce22000-12-12 23:11:42 +0000272if zip(a, b) != t: raise TestFailed, 'zip(a, b) - b is longer'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000273class I:
Fred Drake004d5e62000-10-23 17:22:08 +0000274 def __getitem__(self, i):
275 if i < 0 or i > 2: raise IndexError
276 return i + 4
Fred Drake132dce22000-12-12 23:11:42 +0000277if zip(a, I()) != t: raise TestFailed, 'zip(a, b) - b is instance'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000278exc = 0
279try:
Fred Drake004d5e62000-10-23 17:22:08 +0000280 zip()
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000281except TypeError:
Fred Drake004d5e62000-10-23 17:22:08 +0000282 exc = 1
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000283except:
Fred Drake004d5e62000-10-23 17:22:08 +0000284 e = sys.exc_info()[0]
285 raise TestFailed, 'zip() - no args, expected TypeError, got %s' % e
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000286if not exc:
Fred Drake004d5e62000-10-23 17:22:08 +0000287 raise TestFailed, 'zip() - no args, missing expected TypeError'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000288
289exc = 0
290try:
Fred Drake004d5e62000-10-23 17:22:08 +0000291 zip(None)
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000292except TypeError:
Fred Drake004d5e62000-10-23 17:22:08 +0000293 exc = 1
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000294except:
Fred Drake004d5e62000-10-23 17:22:08 +0000295 e = sys.exc_info()[0]
296 raise TestFailed, 'zip(None) - expected TypeError, got %s' % e
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000297if not exc:
Fred Drake004d5e62000-10-23 17:22:08 +0000298 raise TestFailed, 'zip(None) - missing expected TypeError'
Barry Warsaw370a29f2000-10-01 04:28:43 +0000299class G:
Fred Drake004d5e62000-10-23 17:22:08 +0000300 pass
Barry Warsaw370a29f2000-10-01 04:28:43 +0000301exc = 0
302try:
Fred Drake004d5e62000-10-23 17:22:08 +0000303 zip(a, G())
Tim Peters8572b4f2001-05-06 01:05:02 +0000304except TypeError:
Fred Drake004d5e62000-10-23 17:22:08 +0000305 exc = 1
Barry Warsaw370a29f2000-10-01 04:28:43 +0000306except:
Fred Drake004d5e62000-10-23 17:22:08 +0000307 e = sys.exc_info()[0]
308 raise TestFailed, 'zip(a, b) - b instance w/o __getitem__'
Barry Warsaw370a29f2000-10-01 04:28:43 +0000309if not exc:
Tim Peters8572b4f2001-05-06 01:05:02 +0000310 raise TestFailed, 'zip(a, b) - missing expected TypeError'
Barry Warsaw7bfc1a12000-08-03 15:48:07 +0000311
Guido van Rossum3bead091992-01-27 17:00:37 +0000312
313# Epilogue -- unlink the temp file
314
315unlink(TESTFN)