tests/test-trusted.py
changeset 25660 328739ea70c3
parent 19872 681f7b9213a4
child 26587 56b2bcea2529
equal deleted inserted replaced
25659:d60678a567a9 25660:328739ea70c3
   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