Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(274018)

Side by Side Diff: Lib/test/test_sys.py

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 8 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 # sys.floatinfo 719 # sys.floatinfo
720 check(sys.float_info, size(vh) + self.P * len(sys.float_info)) 720 check(sys.float_info, size(vh) + self.P * len(sys.float_info))
721 # frame 721 # frame
722 import inspect 722 import inspect
723 CO_MAXBLOCKS = 20 723 CO_MAXBLOCKS = 20
724 x = inspect.currentframe() 724 x = inspect.currentframe()
725 ncells = len(x.f_code.co_cellvars) 725 ncells = len(x.f_code.co_cellvars)
726 nfrees = len(x.f_code.co_freevars) 726 nfrees = len(x.f_code.co_freevars)
727 extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\ 727 extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
728 ncells + nfrees - 1 728 ncells + nfrees - 1
729 check(x, size(vh + '12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) 729 check(x, size(vh + '13P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
730 # function 730 # function
731 def func(): pass 731 def func(): pass
732 check(func, size(h + '11P')) 732 check(func, size(h + '11P'))
733 class c(): 733 class c():
734 @staticmethod 734 @staticmethod
735 def foo(): 735 def foo():
736 pass 736 pass
737 @classmethod 737 @classmethod
738 def bar(cls): 738 def bar(cls):
739 pass 739 pass
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 # XXX 871 # XXX
872 # sys.flags 872 # sys.flags
873 check(sys.flags, size(vh) + self.P * len(sys.flags)) 873 check(sys.flags, size(vh) + self.P * len(sys.flags))
874 874
875 875
876 def test_main(): 876 def test_main():
877 test.support.run_unittest(SysModuleTest, SizeofTest) 877 test.support.run_unittest(SysModuleTest, SizeofTest)
878 878
879 if __name__ == "__main__": 879 if __name__ == "__main__":
880 test_main() 880 test_main()
OLDNEW

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+