| OLD | NEW |
| 1 import unittest, test.support | 1 import unittest, test.support |
| 2 import sys, io, os | 2 import sys, io, os |
| 3 import struct | 3 import struct |
| 4 import subprocess | 4 import subprocess |
| 5 import textwrap | 5 import textwrap |
| 6 import warnings | 6 import warnings |
| 7 import operator | 7 import operator |
| 8 import codecs | 8 import codecs |
| 9 | 9 |
| 10 # count the number of test runs, used to create unique | 10 # count the number of test runs, used to create unique |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 def __hash__(self): | 506 def __hash__(self): |
| 507 return 123 | 507 return 123 |
| 508 | 508 |
| 509 self.assertRaises(TypeError, sys.intern, S("abc")) | 509 self.assertRaises(TypeError, sys.intern, S("abc")) |
| 510 | 510 |
| 511 def test_sys_flags(self): | 511 def test_sys_flags(self): |
| 512 self.assertTrue(sys.flags) | 512 self.assertTrue(sys.flags) |
| 513 attrs = ("debug", | 513 attrs = ("debug", |
| 514 "inspect", "interactive", "optimize", "dont_write_bytecode", | 514 "inspect", "interactive", "optimize", "dont_write_bytecode", |
| 515 "no_user_site", "no_site", "ignore_environment", "verbose", | 515 "no_user_site", "no_site", "ignore_environment", "verbose", |
| 516 "bytes_warning", "quiet") | 516 "bytes_warning", "quiet", "no_random_hash") |
| 517 for attr in attrs: | 517 for attr in attrs: |
| 518 self.assertTrue(hasattr(sys.flags, attr), attr) | 518 self.assertTrue(hasattr(sys.flags, attr), attr) |
| 519 self.assertEqual(type(getattr(sys.flags, attr)), int, attr) | 519 self.assertEqual(type(getattr(sys.flags, attr)), int, attr) |
| 520 self.assertTrue(repr(sys.flags)) | 520 self.assertTrue(repr(sys.flags)) |
| 521 self.assertEqual(len(sys.flags), len(attrs)) | 521 self.assertEqual(len(sys.flags), len(attrs)) |
| 522 | 522 |
| 523 def test_clear_type_cache(self): | 523 def test_clear_type_cache(self): |
| 524 sys._clear_type_cache() | 524 sys._clear_type_cache() |
| 525 | 525 |
| 526 def test_ioencoding(self): | 526 def test_ioencoding(self): |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 # XXX | 894 # XXX |
| 895 # sys.flags | 895 # sys.flags |
| 896 check(sys.flags, size(vh) + self.P * len(sys.flags)) | 896 check(sys.flags, size(vh) + self.P * len(sys.flags)) |
| 897 | 897 |
| 898 | 898 |
| 899 def test_main(): | 899 def test_main(): |
| 900 test.support.run_unittest(SysModuleTest, SizeofTest) | 900 test.support.run_unittest(SysModuleTest, SizeofTest) |
| 901 | 901 |
| 902 if __name__ == "__main__": | 902 if __name__ == "__main__": |
| 903 test_main() | 903 test_main() |
| OLD | NEW |