OLD | NEW |
1 # Python test set -- part 5, built-in exceptions | 1 # Python test set -- part 5, built-in exceptions |
2 | 2 |
3 import os | 3 import os |
4 import sys | 4 import sys |
5 import unittest | 5 import unittest |
6 import warnings | 6 import warnings |
7 import pickle, cPickle | 7 import pickle, cPickle |
8 | 8 |
9 from test.test_support import TESTFN, unlink, run_unittest | 9 from test.test_support import TESTFN, unlink, run_unittest |
10 | 10 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 def testUnicodeStrUsage(self): | 332 def testUnicodeStrUsage(self): |
333 # Make sure both instances and classes have a str and unicode | 333 # Make sure both instances and classes have a str and unicode |
334 # representation. | 334 # representation. |
335 self.failUnless(str(Exception)) | 335 self.failUnless(str(Exception)) |
336 self.failUnless(unicode(Exception)) | 336 self.failUnless(unicode(Exception)) |
337 self.failUnless(str(Exception('a'))) | 337 self.failUnless(str(Exception('a'))) |
338 self.failUnless(unicode(Exception(u'a'))) | 338 self.failUnless(unicode(Exception(u'a'))) |
339 | 339 |
340 | 340 |
341 def test_main(): | 341 def test_main(): |
342 import test_support | 342 from test import test_support |
343 if test_support.is_jython: | 343 if test_support.is_jython: |
344 # XXX: http://bugs.jython.org/issue1063 | 344 # XXX: http://bugs.jython.org/issue1063 |
345 del ExceptionTests.testInfiniteRecursion | 345 del ExceptionTests.testInfiniteRecursion |
346 run_unittest(ExceptionTests) | 346 run_unittest(ExceptionTests) |
347 | 347 |
348 if __name__ == '__main__': | 348 if __name__ == '__main__': |
349 test_main() | 349 test_main() |
OLD | NEW |