equal
deleted
inserted
replaced
167 print "# error handling" |
167 print "# error handling" |
168 |
168 |
169 def assertraises(f, exc=util.Abort): |
169 def assertraises(f, exc=util.Abort): |
170 try: |
170 try: |
171 f() |
171 f() |
172 except exc, inst: |
172 except exc as inst: |
173 print 'raised', inst.__class__.__name__ |
173 print 'raised', inst.__class__.__name__ |
174 else: |
174 else: |
175 print 'no exception?!' |
175 print 'no exception?!' |
176 |
176 |
177 print "# file doesn't exist" |
177 print "# file doesn't exist" |
186 f.write('foo') |
186 f.write('foo') |
187 f.close() |
187 f.close() |
188 |
188 |
189 try: |
189 try: |
190 testui(user='abc', group='def', silent=True) |
190 testui(user='abc', group='def', silent=True) |
191 except error.ParseError, inst: |
191 except error.ParseError as inst: |
192 print inst |
192 print inst |
193 |
193 |
194 try: |
194 try: |
195 testui(debug=True, silent=True) |
195 testui(debug=True, silent=True) |
196 except error.ParseError, inst: |
196 except error.ParseError as inst: |
197 print inst |
197 print inst |